Close button event working