fix saveDocumentWithValidation for quotes in error messages