             let tapBackgroundView = UITapGestureRecognizer.init(target: self, action: #selector(self.dismiss))
             tapBackgroundView.numberOfTouchesRequired = 1
             tapBackgroundView.numberOfTapsRequired = 1
-            mainView.addGestureRecognizer(tapBackgroundView)
+            backgroundView.addGestureRecognizer(tapBackgroundView)
         }
         
         blur = SSBlurView.init(to: self)

                self.backgroundView.removeFromSuperview()
                self.customView.removeAllSubviews()
                self.removeFromSuperview()
            }
        }
        layer.pop_add(offscreenAnimation, forKey: "offscreenAnimation")

    
    @objc public func dismiss()
    {
        var propertyNamed = ""
        var offsetValue : CGFloat = 0

