             print("no image to crop")
             delegate?.fusumaImageSelected(view.image, source: mode)
             
-            self.dismiss(animated: true) {
-            
+            self.doDismiss {
+
                 self.delegate?.fusumaDismissedWithImage(view.image, source: self.mode)
             }
         }

public var fusumaCameraTitle     = "Photo"
public var fusumaVideoTitle      = "Video"
public var fusumaTitleFont       = UIFont(name: "AvenirNext-DemiBold", size: 15)

@objc public enum FusumaMode: Int {
    

    @IBAction func doneButtonPressed(_ sender: UIButton) {
        
        allowMultipleSelection ? fusumaDidFinishInMultipleMode() : fusumaDidFinishInSingleMode()
    }
    
    fileprivate func doDismiss(completion: (() -> Void)?) {
        
        if autoDismiss {
            
            self.dismiss(animated: true) {
                
                completion?()
            }
        
        } else {
           
            completion?()
        }
    }
    
    private func fusumaDidFinishInSingleMode() {
