fix simulation bug