     }
 
     func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
-        return model.count
+        return activeModel.count
     }
 
     func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
         let cell = tableView.dequeueReusableCellWithIdentifier(cellIdentifier, forIndexPath: indexPath) as! ChatCell
 
-        cell.inject(chat: model[indexPath.row])
+        cell.inject(chat: activeModel[indexPath.row])
 
         return cell
     }

            let insideChatVC = segue.destinationViewController as? InsideChatViewController,
            let selectedPath = tableView.indexPathForSelectedRow {

            let chat = model[selectedPath.row]
            insideChatVC.chatID = chat.chatID
            insideChatVC.chatName = chat.name
            tableView.deselectRowAtIndexPath(selectedPath, animated: true)


    @IBOutlet private var tableView: UITableView!

    private var searchModel: [Chat]?
    private var fullModel = [Chat]()
    private var activeModel: [Chat] {
        get {
            return searchModel ?? fullModel
        }
    }
    private var cellIdentifier = "ChatCell"
    private var plusButtonHeight: CGFloat = 72

    override func viewDidLoad() {
        ChatClient.getList(success: { chats in
            self.fullModel = chats
            self.tableView.reloadData()
        })

