add condition to popup focus