     
     override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
         let cell = UITableViewCell(style: .default, reuseIdentifier: nil)
-        cell.textLabel?.text = Clink.shared.connectedPeers[indexPath.row].id.uuidString
+        
+        DispatchQueue.main.async {
+            let peers = Clink.shared.connectedPeers
+            guard peers.count - 1 >= indexPath.row else { return }
+            cell.textLabel?.text = peers[indexPath.row].id.uuidString
+        }
+        
         return cell
     }
     

    }
    
    func clink(_ clink: Clink, didUpdateDataForPeer peer: ClinkPeer) {
        print(#function)
    }
    
    func clink(_ clink: Clink, didCatchError error: Error) {



class TableViewController: UITableViewController, ClinkDelegate {
    override func viewDidLoad() {
        super.viewDidLoad()
        
