Function name could be changed to destroyPopup.