     }
 
     public func dismiss(completion: (() -> ())?) {
-        self.presentingViewController?.dismissViewControllerAnimated(true, completion: completion)
+        disableActions = true
+        presentingViewController?.dismissViewControllerAnimated(true) { [weak self] in
+            self?.disableActions = false
+            completion?()
+        }
     }
     
     // MARK: - View controller behavior

    }
    
    public func collectionView(collectionView: UICollectionView, shouldSelectItemAtIndexPath indexPath: NSIndexPath) -> Bool {
        return actionForIndexPath(actionIndexPathFor(indexPath))?.enabled == true
    }
    
    public func collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath) {

        
        collectionView.contentInset = UIEdgeInsets(top: topInset, left: currentInset.left, bottom: bottomInset, right: currentInset.right)
    }

    // MARK: - Private properties

    private var disableActions = false
    private var isPresenting = false

    private var _dynamicSectionIndex: Int?
    private var _headerData: RawData<HeaderDataType>?
    private var _sections = [Section<ActionDataType, SectionHeaderDataType>]()
