Fixed bug with user parameter on database queries