fixed errors handling in HtmlParser