Foudn the infinite loop error. It's in SEarchForSegment.