fix the segment tool