diff --git a/R/sim_all.R b/R/sim_all.R
index 98fd1c86ecccd6a204ca390a4335318a580c0f0d..671e767240f6f2509bb47575d999f737a268c1db 100644
--- a/R/sim_all.R
+++ b/R/sim_all.R
@@ -45,7 +45,7 @@ sim_all <- function(nosim=2, resps, destype=NULL, designpath, u, bcoeff, decisio
   }
 
 
-  if (no_sim < chunks) {
+  if (nosim < chunks) {
     stop("You cannot have more chunks than runs. The number of chunks tells us how often we save the simulation results on disk. Maximum one per run.")
   }