fix broken segment creation