fixed addResources

fixed addResource function, now its takes value from database and user,
adds and sends to database back