listen to popup events