fixed a bug in the peak detection code