last segment bug