an error with first samples of segments fixed