fix popup bugs