         }
         let newMessagesCount = messages.count - _lastTimeMessagesCount
 
-        currentDisplayedMessagesRange.length += Int(newMessagesCount)
+        displayedMessagesRange.length += Int(newMessagesCount)
 
         var indexPaths = [NSIndexPath]()
         for i in 0..<newMessagesCount {
-            let indexPath = NSIndexPath(forItem: currentDisplayedMessagesRange.length - 1 + Int(i), inSection: 0)
+            let indexPath = NSIndexPath(forItem: displayedMessagesRange.length - 1 + Int(i), inSection: 0)
             indexPaths.append(indexPath)
         }
 
-        self.conversationCollectionView.insertItemsAtIndexPaths(indexPaths)
+        conversationCollectionView.insertItemsAtIndexPaths(indexPaths)
 
         if newMessagesCount > 0 {
 

                break
            }

        }
    }
}

    }

    func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
        return displayedMessagesRange.length
    }

    func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell {

        let message = messages.objectAtIndex(UInt(displayedMessagesRange.location + indexPath.item)) as! Message

        if message.mediaType == MessageMediaType.SectionDate.rawValue {
            let cell = collectionView.dequeueReusableCellWithReuseIdentifier(chatSectionDateCellIdentifier, forIndexPath: indexPath) as! ChatSectionDateCell
