add detection of game over