make close button work