   }
   
   deinit {
-    UserDefaults.standard.removeObserver(self, forKeyPath: "savePath")
-    UserDefaults.standard.removeObserver(self, forKeyPath: "feedURL")
+    UserDefaults.standard.removeObserver(self, forKeyPath: "savePath", context: &kvoContext)
+    UserDefaults.standard.removeObserver(self, forKeyPath: "feedURL", context: &kvoContext)
   }
 }
 

    if !Defaults.shared.isConfigurationValid { showWindow(self) }
    
    // TODO: encapsulate this
    UserDefaults.standard.addObserver(self, forKeyPath: "savePath", options: .new, context: nil)
    UserDefaults.standard.addObserver(self, forKeyPath: "feedURL", options: .new, context: nil)
  }
  
  override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey:Any]?, context: UnsafeMutableRawPointer?) {
    refreshInvalidInputMarkers()
  }
  
  fileprivate func refreshInvalidInputMarkers() {

    window?.toolbar?.selectedItemIdentifier = "Tweaks"
  }
}

private var kvoContext = 0
