Fixed issue with simulation