           if err?
             callback err
           else
-            trigger = 0
-            for obj in res
-              if _.isEqual obj, newConf
-                trigger += 1
-                break
-            if trigger is 0
+            filteredMounts = [mount for mount in res when mount.remotehost is options.remotehost][0]
+            if filteredMounts.length is 0
               res.push newConf
               jsonConf = JSON.stringify res
               fs.writeFile cfg, jsonConf, 'utf-8',(err)->

      if err?
        callback err
      else
        index = 0
        filteredMounts = [mount for mount in res when mount.remotehost isnt remotehost][0]
        jsonConf = JSON.stringify filteredMounts or ''
        fs.writeFile cfg, jsonConf, 'utf-8',(err)->


        mount.username  = options.username
        mount.storepass = options.storepass
        mount.mountonly = yes

        switch mount.remotetype
          when "ftp"
