Validation and XSS protection added