Added XSS protection to edit as well