fixed #900.  Implemented popups as a stack instead of single enumeration