fix simulation not working