Handle doctype