fix for null error on getSegment()