added handler for close button