Fixed the x button issue