fix popup close, placed all handlers into primary event