Detect when the game end and alert