Fixes #1033 issue with XSS in popup