fixed bug with wrong simulation