Better popup management