Modifying getHTML function