fixed a minor bug which would cause a crash in the simulator