     
     override func awakeFromNib() {
         super.awakeFromNib()
-        self.tableView.doubleAction = #selector(onTableViewDoubleClicked(_:))
+        tableView.doubleAction = #selector(onTableViewDoubleClicked(_:))
     }
     
     // MARK: Actions

        let command = Preference.shared.commands[sender.clickedRow]
        let commandViewController = CommandViewController(command)
        let oldKey = command.key
        commandViewController.save = { (command) in
            log.verbose("save command: \(command)")
            MASShortcutMonitor.shared().unregisterShortcut(oldKey)
            Preference.shared.setCommand(id: command.id, command: command)
            MASShortcutMonitor.shared().register(command: command)
            self.tableView.reloadData()
        }
        self.presentViewControllerAsSheet(commandViewController)
    }
    
    @IBAction func onAddCommandButtonClicked(_ sender: NSButton) {
        let commandViewController = CommandViewController()
        commandViewController.save = { (command) in
            log.verbose("save command: \(command)")
            MASShortcutMonitor.shared().register(command: command)
            Preference.shared.append(command)
            self.tableView.reloadData()
        }
        self.presentViewControllerAsSheet(commandViewController)
    }
    
    @IBAction func onRemoveButtonClicked(_ sender: NSButton) {
        if (tableView.numberOfSelectedRows < 1) {
            log.warning("no row selected")
            return
        }
        let preference = Preference.shared
        let command = preference.commands[self.tableView.selectedRow]
        MASShortcutMonitor.shared().unregister(command: command)
        Preference.shared.remove(commandAt: self.tableView.selectedRow)
        self.tableView.reloadData()
    }
    
    // MARK: NSTableViewDataSource

                    command.key = sender?.shortcutValue
                    Preference.shared.setCommand(id: command.id, command: command)
                    MASShortcutMonitor.shared().register(command: command)
                    log.info("row: \(row), shortcut changed: \(String(describing: sender?.shortcutValue))")
                }
                return cell
            }
