sorting out the popup business