added encodeHtml and decodeHtml methods