Improved protection against XSS vulnerability