fix bug undefined log in get_notes
fix bug: index does not exist when timestamps.count is 1
fix bug: segment[index] is nil