      */
     fileprivate func dismissAnimated(_ animated: Bool) {
         // If the dismiss timer is nil, snackbar is dismissing or not ready to dismiss.
-        if dismissTimer == nil {
+        if dismissTimer == nil || superview == nil {
             return
         }
         

        addConstraints([contentViewTopConstraint!, contentViewBottomConstraint!, contentViewLeftConstraint!, contentViewRightConstraint!])
        
        // Get current window
        let currentWindow: UIWindow! = UIApplication.shared.windows.filter {$0.isKeyWindow}.first
        
        // Get super view to show
        if let superView = containerView ?? currentWindow {

              UIAccessibility.post(notification: .announcement, argument: self.message)
            }
        } else {
            debugPrint("TTGSnackbar needs a keyWindows to display.")
        }
    }
    
