Updated code for adding html to the dom.