     @updateOptionsLabel()
 
   destroy: ->
-    @subscriptions.dispose()
+    @subscriptions?.dispose()
+    @tooltipSubscriptions?.dispose()
 
   setPanel: (@panel) ->
     @subscriptions.add @panel.onDidChangeVisible (visible) =>

    atom.workspaceView.removeClass('find-visible')

  hideAllTooltips: ->
  #   @regexOptionButton.hideTooltip()
  #   @caseOptionButton.hideTooltip()
  #   @selectionOptionButton.hideTooltip()
  #
  #   @nextButton.hideTooltip()
  #
  #   @replaceNextButton.hideTooltip()
  #   @replaceAllButton.hideTooltip()

  handleEvents: ->
    @handleFindEvents()


  didShow: ->
    atom.workspaceView.addClass('find-visible')
    return if @tooltipSubscriptions?

    @tooltipSubscriptions = subs = new CompositeDisposable
    subs.add atom.tooltips.add @regexOptionButton,
      title: "Use Regex"
      keyBindingCommand: 'find-and-replace:toggle-regex-option',
      keyBindingTarget: @findEditor[0]
    subs.add atom.tooltips.add @caseOptionButton,
      title: "Match Case",
      keyBindingCommand: 'find-and-replace:toggle-case-option',
      keyBindingTarget: @findEditor[0]
    subs.add atom.tooltips.add @selectionOptionButton,
      title: "Only In Selection",
      keyBindingCommand: 'find-and-replace:toggle-selection-option',
      keyBindingTarget: @findEditor[0]

    subs.add atom.tooltips.add @nextButton,
      title: "Find Next",
      keyBindingCommand: 'find-and-replace:find-next',
      keyBindingTarget: @findEditor[0]

    subs.add atom.tooltips.add @replaceNextButton,
      title: "Replace Next",
      keyBindingCommand: 'find-and-replace:replace-next',
      keyBindingTarget: @replaceEditor[0]
    subs.add atom.tooltips.add @replaceAllButton,
      title: "Replace All",
      keyBindingCommand: 'find-and-replace:replace-all',
      keyBindingTarget: @replaceEditor[0]

  didHide: ->
    @hideAllTooltips()
