Fixed the bug of resuming the game