     // Cliqz: Added to diffrentiate between navigating a website or searching for something when app goes to background
     func SELappDidEnterBackgroundNotification() {
         
-        displayedPopoverController?.dismissViewControllerAnimated(false, completion: nil)
-        
+		displayedPopoverController?.dismissViewControllerAnimated(false) {
+			self.displayedPopoverController = nil
+		}
+
         isAppResponsive = false
         
         if self.tabManager.selectedTab?.isPrivate == false {

    override func viewWillTransitionToSize(size: CGSize, withTransitionCoordinator coordinator: UIViewControllerTransitionCoordinator) {
        super.viewWillTransitionToSize(size, withTransitionCoordinator: coordinator)

        displayedPopoverController?.dismissViewControllerAnimated(true, completion: nil)

        guard let displayedPopoverController = self.displayedPopoverController else {
            return

    }

    func SELappWillResignActiveNotification() {
		// Dismiss any popovers that might be visible
		displayedPopoverController?.dismissViewControllerAnimated(false) {
			self.displayedPopoverController = nil
		}

		// If we are displying a private tab, hide any elements in the tab that we wouldn't want shown
        // when the app is in the home switcher
		
        guard let privateTab = tabManager.selectedTab where privateTab.isPrivate else {
            return
        }
