     }
     
     func outsidePendingSegment() {
+        self.checkingForPendingConnections = false
         friendsTableView.tableHeaderView = nil
         self.resultSearchController.active = false
     }

                            self.users.removeAll(keepCapacity: false)
                            self.users = facebookUsers as! [TGUser]
                            
                            dispatch_async(dispatch_get_main_queue(), { () -> Void in
                                self.facebookLogInButton.hidden = true
                                self.friendsTableView.reloadData()

                
                self.users = self.fromUsers
                
                self.users.sortInPlace({ (contact1, contact2) -> Bool in
                    return contact1.username < contact2.username
                })
                
                dispatch_async(dispatch_get_main_queue(), { () -> Void in
                    
                    self.friendsTableView.reloadData()
