   # returns the main chart
   current: -> @chart_holders['main_chart']
 
+  # ugly
   remove_pin: (holder_id) =>
     chart_settings = App.settings.get('charts')
     chart_settings[holder_id].chart_id = false
+    chart_settings[holder_id].format = null
     App.settings.save({charts: chart_settings})
     holder = $('#' + holder_id).parents('.chart_holder')
     holder.find("a.pin_chart").removeClass("icon-lock").addClass("icon-unlock")

          new_chart.series.add(s)

        # if the chart was pinned as table let's set the instance variable
        show_as_table = App.settings.get('charts')[holder_id].format == 'table'
        if show_as_table
          new_chart.view.display_as_table = true


        format = null
      else
        value = chart_id

      chart_settings[holder_id].chart_id = value
      chart_settings[holder_id].format = format
      App.settings.save({charts: chart_settings})
