Fitting galaxy SED and spectra simultaneously