fix a bug caused by not closing the HtmlParser