             } else if let message = currentNavigationBarOnBack {
                 onControllerDidShow = { self.mailbox.dispatch(message: message) }
             } else {
-                onControllerDidShow = { }
+                onControllerDidShow = .none
             }
         }
     }
     
     public func navigationController(_ navigationController: UINavigationController,
                                      didShow viewController: UIViewController, animated: Bool) {
-        onControllerDidShow()
-        onControllerDidShow = { }
-        onPop = { }
+        if let onControllerDidShow = onControllerDidShow {
+            onControllerDidShow()
+        }
+        onControllerDidShow = .none
+        onPop = .none
     }
     
 }

                                     willShow viewController: UIViewController, animated: Bool) {
        if pushingViewController {
            pushingViewController = false
            onControllerDidShow = { }
        } else if !pushingViewController && topViewController != .none {
            // If a controller is not being pushed and the top view controller
            // is not nil then the navigation controller is poping the top view controller.

    private let statusBarStyle: UIStatusBarStyle
    private var pushingViewController = false
    private var currentNavigationBarOnBack: MessageType? = .none
    private var onControllerDidShow: (() -> Void)? = .none
    private var onPop: (() -> Void)? = .none
    
    init(customComponentRenderer: CustomComponentRendererType, layoutEngine: LayoutEngine, statusBarStyle: UIStatusBarStyle = .`default`) {
