     
     override open func pushViewController(_ viewController: UIViewController, animated: Bool) {
         let push = shouldPushViewController(viewController: viewController, animated: animated) { [weak self] _ in
-            self?.foundDelegate = nil
+            self?.foundViewController = nil
         }
         
         if push {


    weak var activeDelegate: UISideMenuNavigationControllerDelegate? {
        guard !view.isHidden else { return nil }
        return sideMenuDelegate ?? foundDelegate ?? findDelegate(forViewController: presentingViewController)
    }

    func findDelegate(forViewController: UIViewController?) -> UISideMenuNavigationControllerDelegate? {
        if let navigationController = forViewController as? UINavigationController {
            return findDelegate(forViewController: navigationController.topViewController)
        }
        if let tabBarController = forViewController as? UITabBarController {
            return findDelegate(forViewController: tabBarController.selectedViewController)
        }
        if let splitViewController = forViewController as? UISplitViewController {
            return findDelegate(forViewController: splitViewController.viewControllers.last)
        }

        foundDelegate = forViewController as? UISideMenuNavigationControllerDelegate
        return foundDelegate
    }

    func setup() {

        // the view hierarchy leaving the screen black/empty. This is because the transition moves views within a container
        // view, but dismissing without animation removes the container view before the original hierarchy is restored.
        // This check corrects that.
        if let foundViewController = self.visibleViewController(from: presentingViewController), foundViewController.view.window == nil {
            transitionController?.transition(presenting: false, animated: false)
        }

