added static variable to switch between showing popup