                 objs.append(obj)
             }
             
+            if objs.count == 0 {
+                return
+            }
+
+            let indexPaths = self.dataController.insert(objs)
             let contentHeight = self.collectionView!.contentSize.height
             let offsetY = self.collectionView!.contentOffset.y
             let bottomOffset = contentHeight - offsetY

            CATransaction.begin()
            CATransaction.setDisableActions(true)
            
            let indexPaths = self.dataController.insert(objs)
            self.collectionView?.performBatchUpdates({ 
                self.collectionView?.insertItems(at: indexPaths)
            }, completion: { (completed) in

extension ChatViewController {
    
    override func collectionView(_ collectionView: UICollectionView, willDisplay cell: UICollectionViewCell, forItemAt indexPath: IndexPath) {
        if indexPath.row == 0 {
            if let message = dataController.itemAt(indexPath)?.message {
                loadMoreMessagesFrom(date: message.createdAt)
            }
