Having issues with essentialmode money system


I’m having difficulties trying to access the money stored in EssentialMode’s database. I’m using EssentialMode Robbery System as a source of money (I had to fix the resource myself since it wasn’t working originally) and after the money gets added to the database, and I exit the server and log back in, I can’t see the money I have until I break into another store (until new money gets added)

I’ve tried this (slightly modified) method of updating the money when a player logs in from here:

AddEventHandler('es:playerLoaded', function(source)
-- Get the current amount for the player
 TriggerEvent('es:getPlayerFromId', source, function(user)
 -- Activate the money for the current player

 -- Send the player some information regarding the money
 TriggerClientEvent('chatMessage', source, "SYSTEM", {187, 235, 42}, "Your money amount is: $" .. tostring(user.money))

and when I log in I get this error from the server console:

ES_ERROR: There seems to be an issue while setting money, something else then a number was entered.

I also get the message in the FiveM chat like

SYSTEM: Your money amount is: $nil

When I rob stores, the money gets added to what i’ve had before, but when I access CouchDB from my browser, there’s only one entry in essentialmode database with money: 0, bank: 0

Any ideas ?