             let orientation = UIApplication.sharedApplication().statusBarOrientation
             if orientation == .Unknown { return }
             if lastOrientation != orientation {
-                lastOrientation = orientation
                 calendarView.collectionViewLayout.invalidateLayout()
                 let layout = calendarView.collectionViewLayout as! JTAppleCalendarLayoutProtocol
-                layout.clearCache()
-                calendarView.reloadData()
+                layout.clearCache()   
+                lastOrientation = orientation
             }
             updateLayoutItemSize(self.calendarView.collectionViewLayout as! JTAppleCalendarLayoutProtocol)
         }

    }()
    
    private func updateLayoutItemSize (layout: JTAppleCalendarLayoutProtocol) {
        if delegate == nil { return }// If the delegate is not set yet, then return
        
        // Default Item height
        var height: CGFloat = (self.calendarView.bounds.size.height - layout.headerReferenceSize.height) / CGFloat(cachedConfiguration.numberOfRows)
        // Default Item width

        
        let dayOfWeek: DaysOfWeek
        switch componentWeekDay {
            case 1:  dayOfWeek = .Sunday
            case 2:  dayOfWeek = .Monday
            case 3:  dayOfWeek = .Tuesday
            case 4:  dayOfWeek = .Wednesday
            case 5:  dayOfWeek = .Thursday
            case 6:  dayOfWeek = .Friday
            default: dayOfWeek = .Saturday
        }
        
        let row = {()->Int in return itemIndex / MAX_NUMBER_OF_DAYS_IN_WEEK }
        let column = {()->Int in return itemIndex % MAX_NUMBER_OF_DAYS_IN_WEEK }
        let monthSection = {()->(startDate: NSDate, endDate: NSDate) in return self.dateFromSection(itemSection)! }
        
        let cellState = CellState(
            isSelected: theSelectedIndexPaths.contains(indexPath),
