Fixing segmentQuery