Maybe this *only* needs to be done for "close" event since it will get triggered for all of the other cases?