       traverse = (reference, actual) ->
         for k of reference
           continue if k[0] == '_'
-          if not actual[k]?._timestamp? or actual[k]._timestamp > lastBootstrap
+          if not actual[k]?._timestamp? or actual[k]._timestamp < lastBootstrap
             _tasks.push({device: deviceId, name : 'refreshObject', objectName : reference[k]._path})
           else
             traverse(reference[k], actual[k])

                'InternetGatewayDevice.DeviceInfo.ProductClass' : 1,
              }
              db.devicesCollection.findOne({'_id' : currentRequest.deviceId}, projection, (err, device) ->
                manufacturer = device.InternetGatewayDevice.DeviceInfo.Manufacturer._value
                productClass = device.InternetGatewayDevice.DeviceInfo.ProductClass._value
                db.filesCollection.findOne({'metadata.FileType' : '1 Firmware Upgrade Image', 'metadata.Manufacturer' : manufacturer, 'metadata.ProductClass' : productClass, 'metadata.SoftwareVersion' : presetSoftwareVersion}, {_id : 1}, (err, file) ->

runTask = (currentRequest, task, methodResponse) ->
  timeDiff = process.hrtime()
  tasks.task(task, methodResponse, (err, status, cwmpResponse, deviceUpdates) ->
    throw err if err
    # TODO handle error
    updateDevice(currentRequest, deviceUpdates, (err) ->
      throw err if err

      timeDiff = process.hrtime(timeDiff)[0] + 1
      if timeDiff > 3 # in seconds
