     
     private func dismissAutcompleteSuggestions() {
         guard let controller = autocompleteController else { return }
+        autocompleteController = nil
         controller.view.removeFromSuperview()
         controller.removeFromParentViewController()
-        autocompleteController = nil
     }
     
     @IBAction func onBackPressed(_ sender: UIBarButtonItem) {

    }
    
    func onOmniQuerySubmitted(_ query: String) {
        loadQueryInCurrentTab(query: query)
    }
    
    func onActionButtonPressed() {
        if let current = currentTab, let index = tabManager.indexOf(tab: current) {
            remove(tabAt: index)
        }

    }
    
    fileprivate func loadQueryInCurrentTab(query: String) {
        if let queryUrl = AppUrls.url(forQuery: query) {
            currentTab?.load(url: queryUrl)
        }
