added check for game over