             self.file = file
         }
 
+        NotificationCenter.default.removeObserver(self);
         NotificationCenter.default.addObserver(self, selector: #selector(handleLog), name: NSNotification.Name.ParticleLog, object: nil)
     }
 


    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        let cell:DeviceTableViewCell = self.tableView.dequeueReusableCell(withIdentifier: "log_cell") as! DeviceTableViewCell
        cell.deviceNameLabel.text = logs[indexPath.row].lastPathComponent
        return cell
    }


        let fileURLs = getLogs()
        for i in 0 ..< fileURLs.count {
            try? fileManager.removeItem(at: fileURLs[i])
        }

        if (file != nil) {
            self.startLogging()
        }
    }

