Now updates the dialog when there's a new document.