Finally! Fixed the exit problem. When the user completes the game it should automatically exit the game.