 runTask = (currentRequest, task, methodResponse) ->
   timeDiff = process.hrtime()
   tasks.task(task, methodResponse, (err, status, cwmpResponse, deviceUpdates) ->
-    throw new Error(err) if err?
+    throw err if err
     # TODO handle error
     updateDevice(currentRequest, deviceUpdates, (err) ->
-      throw new Error(err) if err?
+      throw err if err
 
       timeDiff = process.hrtime(timeDiff)[0] + 1
       if timeDiff > 3 # in seconds

          )
        )
      else
        throw Error('ACS method not supported')
    else if cwmpRequest.methodResponse?
      taskId = cwmpRequest.id


        projection[path + '_timestamp'] = 1

    db.devicesCollection.findOne({'_id' : deviceId}, projection, (err, device) ->
      throw err if err
      lastBootstrap ?= device?._lastBootstrap
      _tasks = []

