Added checkHtml function