The effect of collective excitations on the single particle spectra of nuclei