Fixed delete_doc