modify getSegment