update the document