Added  functionality for pause in game and quit