             let t = CACurrentMediaTime() - startTime
             var currentVelocity = velocity * 15.0 * CGFloat(pow(Double(decelerationRate), 1000.0 * t))
             currentOffset.y += currentVelocity
-            let maxOffset = strongSelf.outerScrollView.contentSize.height - strongSelf.outerScrollView.bounds.height
+            let maxOffset = scrollView.contentSize.height - scrollView.bounds.height
             if currentOffset.y >= maxOffset {
                 currentOffset.y = maxOffset
                 currentVelocity = 0.0

    }

    func nestedTransferVelocity(_ velocity: CGFloat) {
        if velocity >= 0.0 {
            return
        }
        self.nestedDeceleration?.isPaused = true
        let startTime = CACurrentMediaTime()
        var currentOffset = self.outerScrollView.contentOffset
        let decelerationRate = outerScrollView.decelerationRate.rawValue
        self.scrollViewDidEndDragging(self.outerScrollView, willDecelerate: true)
        self.nestedDeceleration = ConstantDisplayLinkAnimator(update: { [weak self] in
            guard let strongSelf = self else {
                return

                    outerScrollView.alwaysBounceVertical = true
                }
            }
        } else {
            if scrollView.contentOffset.y <= .ulpOfOne {
                if nestedScrollView.bounces {
                    nestedScrollView.bounces = false
                    nestedScrollView.alwaysBounceVertical = false
