Fix endSimulator method