fix a bug for segments in masspectrum