be more robust against "segments" value