add changes to code to support htmleditor