         retrieveUsers()
         
         open.target = self.revealViewController()
+        searchBar.delegate = self
+        searchDisplayController?.searchResultsDelegate = self;
+        
         open.action = Selector("revealToggle:")
         
         self.view.addGestureRecognizer(self.revealViewController().panGestureRecognizer())
-        searchBar.delegate = self
+        
         //filteredUser = userMessages
         
     }

    }
    
    
    func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
        
        let uid = FIRAuth.auth()!.currentUser!.uid

                    if array.count == 0 {
                        return
                    }
                    // something wrong?
                    if array.count > indexPath.row && value as? String == array[indexPath.row].uid {
                        self.tableview.cellForRow(at: indexPath)?.accessoryType = .checkmark
                    }
                }
