fixe some bug in the simulation