added logic for game over