     var daysInSection: [Int: Int] = [:] // temporary caching
     var monthInfo: [Month] = []
     
-    var isDirty: Bool = false
+    var isDirty: Bool {
+        return updatedLayoutCellSize != cellSize
+    }
     
     var updatedLayoutCellSize: CGSize {
+        guard let cachedConfiguration = delegate.cachedConfiguration else { return .zero }
         
         // Default Item height and width
-        var height: CGFloat = collectionView!.bounds.size.height / CGFloat(delegate.cachedConfiguration.numberOfRows)
+        var height: CGFloat = collectionView!.bounds.size.height / CGFloat(cachedConfiguration.numberOfRows)
         var width: CGFloat = collectionView!.bounds.size.width / CGFloat(maxNumberOfDaysInWeek)
         
         if shouldUseUserItemSizeInsteadOfDefault { // If delegate item size was set

            collectionView!.setContentOffset(firstContentOffset, animated: false)
        }
        daysInSection.removeAll() // Clear chache
        isDirty = false
        executeDelayedTasks()
    }
    

            abs(lastSetCollectionViewSize.width - newBounds.width) > errorDelta
    }
    
    /// Returns the layout attributes for all of the cells
    /// and views in the specified rectangle.
    override open func layoutAttributesForElements(in rect: CGRect) -> [UICollectionViewLayoutAttributes]? {
