     // 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 {

        let controller = helper.createActivityViewController({ [unowned self] completed in
            // After dismissing, check to see if there were any prompts we queued up
            self.showQueuedAlertIfAvailable()

            if completed {
                // We don't know what share action the user has chosen so we simply always

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

		displayedPopoverController?.dismissViewControllerAnimated(true) {
			self.displayedPopoverController = nil
		}

        guard let displayedPopoverController = self.displayedPopoverController else {
            return
