     func tableView(tableView: UITableView, commitEditingStyle editingStyle: UITableViewCellEditingStyle, forRowAtIndexPath indexPath: NSIndexPath) {
 
         if editingStyle == .Delete {
+
+            let conversationsCount = conversations.count
             
             guard let conversation = conversations[safe: indexPath.row] else {
                 tableView.setEditing(false, animated: true)

                }

            }, afterDeleted: {
                SafeDispatch.async {
                    tableView.deleteRowsAtIndexPaths([indexPath], withRowAnimation: .Automatic)
                }

            }, orCanceled: {
                SafeDispatch.async {
                    tableView.setEditing(false, animated: true)
                }
            })
        }


            tryDeleteOrClearHistoryOfConversation(conversation, inViewController: self, whenAfterClearedHistory: {

                SafeDispatch.async { [weak self, weak tableView] in

                    guard let tableView = tableView else { return }

                    tableView.setEditing(false, animated: true)

                    // update cell

                    if let cell = tableView.cellForRowAtIndexPath(indexPath) as? ConversationCell {
                        if let conversation = self?.conversations[safe: indexPath.row] {
                            let radius = min(CGRectGetWidth(cell.avatarImageView.bounds), CGRectGetHeight(cell.avatarImageView.bounds)) * 0.5
                            cell.configureWithConversation(conversation, avatarRadius: radius, tableView: tableView, indexPath: indexPath)
                        }
