Fix an infinite loop when the game is lost