                 } else {
                     clearCurrentBottomView()
                 }
-            } else if currentIndex == prevNumberOfItems - 1 {
+            } else if Int(currentIndex) == Int(prevNumberOfItems) - 1 {
                 setItemViewForCurrentBottomView(actualDataSource.swipeRevealGalleryView(self, viewForItemAtIndex: currentIndex+1))
             }
             

    func decreaseItemsCount(by: UInt){
        guard by > 0 else { return }

        numberOfItems = max(numberOfItems - by, 0)
        
        if numberOfItems < currentIndex + 2 {
            clearCurrentBottomView()

                            innerSelf.currentTopView.userInteractionEnabled = true
                            innerSelf.currentIndex += 1
                            
                            if Int(innerSelf.currentIndex) < Int(innerSelf.numberOfItems) - 1 && innerSelf.dataSource != nil {
                                innerSelf.setItemViewForCurrentBottomView(innerSelf.dataSource!.swipeRevealGalleryView(innerSelf, viewForItemAtIndex: innerSelf.currentIndex+1))
                            } else {
                                innerSelf.clearCurrentBottomView()
