Updated save callback with proper sanitization and error handling. Corrected issue, TEI docs not saving.