Game now closes properly when pressing the close button.