fixed issues with simulation