         print(debug: "safariViewControllerDidFinish")
         dismissIndicator()
         enableSubmitButton()
-    }
-}
+        tdsSecureProcessing = false
+    }
+}

    }

    func presentVerificationScreen(with tdsToken: ThreeDSecureToken) {
        let url = tdsToken.tdsEntryUrl
        if let url = url {
            let safariVc = SFSafariViewController(url: url)
            if #available(iOS 11.0, *) {
                safariVc.dismissButtonStyle = .close
            }
            safariVc.delegate = self
            self.present(safariVc, animated: true, completion: nil)
            tdsSecureProcessing = true
        }
    }

    func didCompleteCardForm(with result: CardFormResult) {

        if tdsSecureProcessing {
            tdsSecureProcessing = false
            if let tdsToken = presenter?.tdsToken {
                presenter?.createToken(tdsToken: tdsToken)
            }
        }
    }
