           callback error, result
       )
 
-  getDeviceOperations: (newDevices=[], oldDevices=[], callback=->) =>
-    debug 'getDeviceOperations'
+  getDevicesByOperation: (newDevices=[], callback=->) =>
+    oldDevices = _.clone @runningDevices
+    debug 'getDevicesByOperation'
     debug 'newDevices', _.pluck(newDevices, 'name')
     debug 'oldDevices', _.pluck(oldDevices, 'name')
 
     devicesToProcess = _.clone newDevices
     async.map devicesToProcess, @deviceExists, (error, remainingDevices) =>
       return callback error if error?
+
       remainingDevices = _.compact remainingDevices
       debug 'devices that exist', _.pluck(remainingDevices, 'name')
 


    child = new (forever.Monitor)('command.js', foreverOptions)
    child.on 'stderr', (data) =>
      debug 'stderr', device.uuid, data.toString()
      @emit 'stderr', data.toString(), device

    child.on 'stdout', (data) =>
      debug 'stdout', device.uuid, data.toString()
      @emit 'stdout', data.toString(), device

    debug 'forever', {uuid: device.uuid, name: device.name}, 'starting'
    child.start()

      debug 'restartDevice error:', error if error?
      @startDevice device, callback

  stopDevice: (device, callback=->) =>
    debug 'stopDevice', device.uuid
    deviceProcess = @deviceProcesses[device.uuid]
    return callback null, device.uuid unless deviceProcess?
