write error in spectra