works from popup