     }
     func updateAudioPlaybackProgress(timer: NSTimer) {
         func updateAudioCellOfMessage(message: Message, withCurrentTime currentTime: NSTimeInterval) {
-            let indexPath = NSIndexPath(forItem: Int(messages.indexOfObject(message)) - currentDisplayedMessagesRange.location, inSection: 0)
+            let indexPath = NSIndexPath(forItem: Int(messages.indexOfObject(message)) - displayedMessagesRange.location, inSection: 0)
 
             if let sender = message.fromFriend {
                 if sender.friendState != UserFriendState.Me.rawValue {

                newMessagesTotalHeight += height
            }
            
            let keyboardAndToolBarHeight = self.messageToolbarBottomConstraint.constant + CGRectGetHeight(messageToolbar.bounds)
            
            let totleMessagesHeight = self.conversationCollectionView.contentSize.height + keyboardAndToolBarHeight + 64.0 + newMessagesTotalHeight
            
            let visableMessageFieldHeight = self.conversationCollectionView.frame.size.height - (keyboardAndToolBarHeight + 64.0)
            
            let totalMessagesContentHeight = self.conversationCollectionView.contentSize.height + keyboardAndToolBarHeight + newMessagesTotalHeight
            
            println("Size is \(self.conversationCollectionView.contentSize.height) \(newMessagesTotalHeight) visableMessageFieldHeight \(visableMessageFieldHeight)")
            
            //Calculate the space can be used
            let useableSpace = visableMessageFieldHeight - self.conversationCollectionView.contentSize.height
            
            self.conversationCollectionView.contentSize = CGSizeMake(self.conversationCollectionView.contentSize.width, self.conversationCollectionView.contentSize.height + newMessagesTotalHeight)
            
            println("Size is after \(self.conversationCollectionView.contentSize.height)")

            if (totleMessagesHeight > self.conversationCollectionView.frame.size.height) {
                println("New Message scroll")
                UIView.animateWithDuration(0.2, delay: 0.0, options: UIViewAnimationOptions.CurveEaseInOut, animations: { () -> Void in
                    
                    if (useableSpace > 0) {
                        let contentToScroll = newMessagesTotalHeight - useableSpace
                        println("contentToScroll \(contentToScroll)")


        navigationController?.interactivePopGestureRecognizer.delaysTouchesBegan = false

        if messages.count >= UInt(messagesBunchCount) {
            displayedMessagesRange = NSRange(location: Int(messages.count) - messagesBunchCount, length: messagesBunchCount)
        } else {
            displayedMessagesRange = NSRange(location: 0, length: Int(messages.count))
        }

        
        let undoBarButtonItem = UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem.Undo, target: self, action: "undoMessageSend")
