Added validate_doc_update function