fix segment timeline calculation