             }
             if isToolbarVisible {
                 addToolbar()
-                perform(#selector(dismissToolbar), with: self, afterDelay: 8)
+                dismissToolbar()
             } else {
                 removeToolbar()
             }

        toolbar.didMove(toParentViewController: owner)
    }
    
    @objc func dismissToolbar() {
        setToolbar(visible: false, animated: true)
    }
    
    func setToolbar(visible: Bool, animated: Bool) {
        let frame = visible ? toolbarFrame.visible : toolbarFrame.hidden
        if animated {
            if visible {
                // add toolbar before animation starts
                isToolbarVisible = visible

                    self.isToolbarVisible = visible
                }
            })
    }
    
    fileprivate lazy var toolbarFrame: (visible: CGRect, hidden: CGRect) = {
