 
       if not taskId
         nextTask(sessionId, deviceId, response, cookies)
-        return
       else
         memcached.get(taskId, (err, task) ->
           runTask(sessionId, deviceId, task, reqParams, response)


  if Object.keys(resParams).length > 0
    memcached.set(String(task._id), task, config.CACHE_DURATION, (err, result) ->
      res = tr069.response(reqParams.sessionId, resParams, {task : String(task._id)})
      writeResponse response, res
    )
    return


      if count == 0
        util.log("#{deviceId}: new device detected")
        devicesCollection.update({'_id' : deviceId}, {'$set' : updates}, {upsert: true, safe: true}, (err) ->
          if err?
            callback(err) if callback?
            return
