Fixed call to createHTMLDocument