improved validation so that the save button is available when an already-valid document loads