fixed a bug with quitting the game