   observeConfig: ->
     @subscriptions.add atom.config.onDidChange 'flex-tool-bar.persistentProjectToolBar', ({newValue}) =>
       @unregisterProjectWatch()
-      @resolveProjectConfigPath(undefined, newValue)
-      @registerProjectWatch()
+      if @resolveProjectConfigPath(undefined, newValue)
+        @registerProjectWatch()
       @reloadToolbar()
 
     @subscriptions.add atom.config.onDidChange 'flex-tool-bar.pollFunctionConditionsToReloadWhenChanged', ({oldValue, newValue}) =>

    @projectConfigWatcher?.close()
    @projectConfigWatcher = null

  registerProjectWatch: ->
    return unless atom.config.get('flex-tool-bar.reloadToolBarWhenEditConfigFile') and @projectConfigFilePath

    @projectConfigWatcher?.close()
    @projectConfigWatcher = chokidar.watch @projectConfigFilePath

        @reloadToolbar()

    @subscriptions.add atom.workspace.onDidChangeActivePaneItem (item) =>
      if @storeProject()
        @storeGrammar()
        @unregisterProjectWatch()
