logic popup handling