make closebutton work