update the document.