Merging Krunal's XSS fix