UICollectionView scrollToItemAtIndexPath crash ios 10

I got this error on iOS 10, but it works fine both on iOS 11 and iOS 9. * Terminating app due to uncaught exception 'NSRangeException', reason: '* -[__NSArrayM objectAtIndex:]: index 5 beyond boun...