 
         case .MessageRecord:
 
-            if itemIndex < (isMoreMessagesFold ? Section.maxNumberOfItems : (filteredUserMessages?.count ?? 0)) {
+            if itemIndex < (isMoreMessagesFold ? Section.maxNumberOfItems : countOfFilteredUserMessages) {
                 let cell = tableView.dequeueReusableCellWithIdentifier(searchedMessageCellID) as! SearchedMessageCell
                 return cell
             } else {

//                return 0
//            }
        case .MessageRecord:
            //return filteredUserMessages?.count ?? 0
            if let count = filteredUserMessages?.count where count > 0 {
                if !isMoreMessagesFold {
                    return count + 1


        case .MessageRecord:

            if itemIndex < (isMoreMessagesFold ? Section.maxNumberOfItems : countOfFilteredUserMessages) {
                guard let
                    userMessages = filteredUserMessages?[safe: itemIndex],
                    cell = cell as? SearchedMessageCell else {
