updating close popup code