fix argument error in the simulation function