added functionality for closing game.