       @add_renderable finder
 
     fn 'find', 'Finds Graphite metrics', (query) ->
-      @value @async ->
-        $result = @output()
-        promise = graphite.find query
-        promise.clicks = new Bacon.Bus
-
-        @renderable promise, ->
-          promise.done ({query, result}) =>
-            query_parts = query.split '.'
-            $ul = $ '<ul class="find-results"/>'
-            for node in result
-              $li = $ '<li class="cm-string"/>'
-              $li.data 'node', node
-              text = node.path
-              text += '*' unless node.is_leaf
-              node_parts = text.split '.'
-              for part, i in node_parts
-                if i > 0
-                  $li.append '.'
-                $span = $ '<span>'
-                $span.addClass 'light' if part == query_parts[i]
-                $span.text part
-                $li.append $span
-
-              promise.clicks.plug $li.asEventStream('click').map (e) -> $(e.target).closest('li').data('node')
-
-              $ul.append $li
-            $result.append $ul
+      promise = graphite.find query
+      promise.clicks = new Bacon.Bus
+
+      @value @renderable promise, @detached -> @async ->
+        $ul = $ '<ul class="find-results"/>'
+        @add_rendered $ul
+        promise.done ({query, result}) =>
+          query_parts = query.split '.'
+          for node in result
+            $li = $ '<li class="cm-string"/>'
+            $li.data 'node', node
+            text = node.path
+            text += '*' unless node.is_leaf
+            node_parts = text.split '.'
+            for part, i in node_parts
+              if i > 0
+                $li.append '.'
+              $span = $ '<span>'
+              $span.addClass 'light' if part == query_parts[i]
+              $span.text part
+              $li.append $span
+
+            promise.clicks.plug $li.asEventStream('click').map (e) -> $(e.target).closest('li').data('node')
+
+            $ul.append $li
+        promise.fail =>
+          @error 'Find request failed'
+        promise
 
     context_vars: -> dsl.define_functions {}, function_names
 

      $a.text url
      $pre = $ '<pre>'
      $pre.append $a
      @output $pre

    fn 'img', 'Renders a Graphite graph image', (args...) ->
      params = args_to_params @, args
      url = graphite.render_url params
      @async ->
        $img = $ "<img src='#{url}'/>"
        @output $img
        deferred = $.Deferred()
        $img.on 'load', deferred.resolve
        $img.on 'error', deferred.reject

        promise = deferred.promise()
        promise.fail (args...) =>
          @error 'Failed to load image'

    fn 'data', 'Fetches Graphite graph data', (args...) ->
      params = args_to_params @, args
      @value @async ->
        promise = graphite.get_data params
        @renderable promise, ->
          $result = @output()
          promise.done (response) =>
            for series in response
              $header = $ '<h3>'
              $header.text series.target
              $result.append $header
              $table = $ '<table>'
              for [value, timestamp] in series.datapoints
                time = moment(timestamp * 1000)
                $table.append "<tr><th>#{time.format('MMMM Do YYYY, h:mm:ss a')}</th><td class='cm-number number'>#{value?.toFixed(3) or '(none)'}</td></tr>"
              $result.append $table
          promise.fail (error) =>
            @error error

    fn 'graph', 'Graphs Graphite data', (args...) ->
      params = Bacon.constant(args).map(args_to_params, @)

        name = name._lead_context_fn?.name if name._lead_op?
        function_docs = docs.function_docs[name]
        if function_docs?
          @div function_docs.docs
          for example in function_docs.examples
            @example "#{default_target_command} #{JSON.stringify example}", run: false
        name = docs.parameter_doc_ids[name] ? name
        parameter_docs = docs.parameter_docs[name]
        if parameter_docs?
          $docs = $(parameter_docs)
          context = @
          $docs.find('a').on 'click', (e) ->
