This function is being called every time the form closes, even if user clicks on update or delete event. So, popup windows raised every time.