added check for doctype and if present, add to html