bugfix in simulation