Update the document