Flush for updating the document