         }
         if viewController == Kitchen.navigationController.viewControllers[0] {
             Kitchen.redirectWindow?.makeKeyAndVisible()
-            if let redirectWindow = Kitchen.redirectWindow {
-                Kitchen.didRedirectToWindow?(redirectWindow)
+            if let _ = Kitchen.redirectWindow {
+                Kitchen.didRedirectToWindow?()
                 Kitchen.didRedirectToWindow = nil
             }
         }

    private static let sharedKitchen = Kitchen()
    private static weak var redirectWindow: UIWindow?
    private static var _navigationControllerDelegateWillShowCount = 0
    private static var didRedirectToWindow: (UIWindow -> ())?

    private var evaluateAppJavaScriptInContext: JavaScriptEvaluationHandler?


    /// - Note: **BETA API** This API is subject to change.
    public static func serve(xmlString xmlString: String,
       type: PresentationType = .Default, redirectWindow: UIWindow,
       didRedirectToWindow: (() -> ())? = nil)
    {
        Kitchen._navigationControllerDelegateWillShowCount = 0
        Kitchen.navigationController.setViewControllers([UIViewController()], animated: true)
