fixed a near infinite loop bug in spectral
fixed a bug in timer