changed method name and added escapeHTMLEntities