     new Error message.replace("MongoError: ")
 
   _hashToken: (token) =>
+    throw new Error 'Invalid Device UUID' unless @uuid?
+
     hasher = crypto.createHash 'sha256'
     hasher.update token
     hasher.update @uuid

              callback null, true

  verifyNewToken: (token, callback=->) =>
    hashedToken = @_hashToken token
    @devices.findOne uuid: @uuid, "meshblu.tokens.#{hashedToken}": {$exists: true}, (error, device) =>
      return callback error if error?
      callback null, !!device

    @devices.findOne uuid: @uuid, (error, data) =>
      return callback error if error?
      delete data.meshblu.hash if data?.meshblu?.hash
      try
        token = @_hashToken JSON.stringify(data)
      catch error
        return callback error
      params = $set :
        'meshblu.hash': token
      debug 'updating hash', @uuid, params
      @devices.update uuid: @uuid, params, callback

