   addPlugin: (hostname, plugin_name, opts) ->
     hostname = helpers.getHostname hostname
 
-    if not @getHostname hostname
+    if not _.size opts 
+      opts = {}
+
+    if @getPlugin hostname, plugin_name
       false
     else
       @config[hostname].push 

      if not @getPlugin hostname, plugin_name
        false
      else 
        #@deletePlugin hostname, plugin_name
        #@addPlugin hostname, plugin_name, opts
        _.each opts, (val, key) ->
          @config[hostname][plugin]['opts'][key] = val



  getPlugin: (hostname, plugin_name) ->
    hostname = helpers.getHostname hostname
    plugins = @getHostname hostname

    if not plugins or not plugin_name
      false
    else 
      plugin = _.where plugins, { name : plugin_name }

      if not plugin.length
        false
      else
        plugin[0]

  updatePlugin: (hostname, plugin_name, opts) ->
    hostname = helpers.getHostname hostname

    if not @getHostname hostname or not plugin_name
