changing document to use doc_type instead of type