                 let delay = seconds * Double(NSEC_PER_SEC)  // nanoseconds per seconds
                 let dispatchTime = DispatchTime.now() + Double(Int64(delay)) / Double(NSEC_PER_SEC)
                 
-
+                
                 if readerConfig.shouldSkipPagesOnEdges {
                     if shouldSkipBackward {
                         FolioReader.sharedInstance.readerCenter.skipPageBackward()
                     } else if shouldSkipForward {
                         FolioReader.sharedInstance.readerCenter.skipPageForward()
-                    } else if self.shouldShowBar && !menuIsVisibleRef {
-                        DispatchQueue.main.asyncAfter(deadline: dispatchTime, execute: {
-                            if self.shouldShowBar && !menuIsVisibleRef {
-                                FolioReader.sharedInstance.readerContainer.toggleNavigationBar()
-                                self.shouldShowBar = true
-                            }
-                        })
                     }
-                }                
-                
+                }
+                
+                if /*self.shouldShowBar && */!menuIsVisibleRef {
+                    DispatchQueue.main.asyncAfter(deadline: dispatchTime, execute: {
+                        FolioReader.sharedInstance.readerContainer.toggleNavigationBar()
+                    })
+                }
+                
+//                self.shouldShowBar = true
             }
         } else if readerConfig.shouldHideNavigationOnTap == true {
             FolioReader.sharedInstance.readerCenter.hideBars()
         }
+        
+//        self.shouldShowBar = true
         
         // Reset menu\
         if menuIsVisible {
             menuIsVisible = false
             selectedHighlightId = nil
-        }
+        } else {
+            shouldShowBar = true
+        }
+    }
+    
+    func handleTapGesture(_ recognizer: UITapGestureRecognizer) {
+        let tapLocation = recognizer.location(in: recognizer.view)
+        
+        print("before timer tapLocation.x: \(tapLocation.x)")
+        
+        Timer.scheduledTimer(timeInterval: TimeInterval(0.4), target: self, selector: #selector(handleTap), userInfo: tapLocation, repeats: false)
     }
     
     // MARK: - Scroll and positioning

        } else if url?.scheme == "font-changed" {
            Timer.scheduledTimer(timeInterval: TimeInterval(0.5), target: self, selector: #selector(fontDidChanged), userInfo: nil, repeats: false)
        }
        return true
    }
    

    func webView(_ webView: UIWebView, shouldStartLoadWith request: URLRequest, navigationType: UIWebViewNavigationType) -> Bool {
        let url = request.url
        
        print("\n### shouldStartLoadWith ###")
        
        if url?.scheme == "highlight" {
            
            print("highlight was pressed")
            
            shouldShowBar = false
            let decoded = url!.absoluteString.removingPercentEncoding!
