fix close button method