 
         case .Online:
 
-            let discoveredUser = searchedUsers[indexPath.row]
+            let discoveredUser = searchedUsers[itemIndex]
             cell.configureWithDiscoveredUser(discoveredUser)
         }
     }


    func tableView(tableView: UITableView, willDisplayCell cell: UITableViewCell, forRowAtIndexPath indexPath: NSIndexPath) {

        guard let cell = cell as? SearchedContactsCell else {
            return
        }

    private var filteredFriends: Results<User>?

    private var searchedUsers = [DiscoveredUser]()

    private var countOfFilteredFriends: Int {
        return filteredFriends?.count ?? 0
    }
    private var countOfSearchedUsers: Int {
        return searchedUsers.count
    }

    //private var searchControllerIsActive = false
    
