handle pausing the game