Segment js error corrected