Functionality to close popup