adding function put_document