Fix popup deletion