update document for preview