         
         // handle end of transition in case no pan gesture
         if panGesture.state != .changed {
+            willFinishAnimationTransition = true
             DispatchQueue.main.asyncAfter(deadline: .now() + animator.animationDuration / Double(kAnimation), execute: {
                 self.finishTransition()
             })

        timerForInteractiveTransition = Timer.scheduledTimer(timeInterval: timeInterval, target: self, selector: #selector(finishAnimationTransition), userInfo: nil, repeats: true)
    }
    
    func finishAnimationTransition() {
        if let fromController = fromControllerInteractive,
            let toController = toControllerInteractive
        {
            let timeOffset: Double = Double(animator.animationProgress) * Double(animator.animationDuration)
            let delta: Float = 0.002
            animator.animationProgress += delta
            
            toController.view.layer.timeOffset = CFTimeInterval(timeOffset)
            fromController.view.layer.timeOffset = CFTimeInterval(timeOffset)
            if animator.animationProgress > 1.0 {
                finishTransition()
            }
        }
    }

            
            // interactive animation
            animator.animationProgress = fmin(fmax(Float(abs(translation.x) / containerView.bounds.width), 0.0), 2.0)
            willFinishAnimationTransition = animator.animationProgress > 5.0
            let timeOffset = animator.animationProgress * Float(animator.animationDuration)
            toControllerInteractive?.view.layer.timeOffset = CFTimeInterval(timeOffset)
            fromControllerInteractive?.view.layer.timeOffset = CFTimeInterval(timeOffset)
