optionally auto-refresh the document when it changes