     @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': @_hashToken JSON.stringify(data)
+        'meshblu.hash': token
       debug 'updating hash', @uuid, params
       @devices.update uuid: @uuid, params, callback
 

    new Error message.replace("MongoError: ")

  _hashToken: (token) =>
    hasher = crypto.createHash 'sha256'
    hasher.update token
    hasher.update @uuid

    @fetch (error, attributes) =>
      return callback error if error?

      try
        hashedToken = @_hashToken token
      catch error
        return callback error

      debug 'storeToken', token, hashedToken
      tokenData = createdAt: new Date()
      @update $set: {"meshblu.tokens.#{hashedToken}" : tokenData}, callback
