added a small check for XSS attacks when the isUserInput flag is true