add error checking to html() class