Fixed the exiting thru x button