diff --git a/src/model_fitting/abundance_model.R b/src/model_fitting/abundance_model.R
index 53ff0f61cad82620816c7396f174958e145b616d..c11cd69be410ebbf76c34ce88e9b5687423672d9 100644
--- a/src/model_fitting/abundance_model.R
+++ b/src/model_fitting/abundance_model.R
@@ -310,7 +310,7 @@ if (!is.na(exclude_grid)){
 if (!is.na(exclude_grid_rand)){
  #bin_id --> randomly exclude percentage given in grid_rand
   ids_to_exclude <- sample(predictors_obs$bin_id,
-                           size = nrow(predictors_obs)/100 * exclude_grid_rand,
+                           size = nrow(predictors_obs)/100 * exclude_grid_rand_perc,
                            replace = FALSE)
 
   predictors_excluded_grid_rand <- predictors_obs[predictors_obs$bin_id %in% ids_to_exclude, ]