Updated users logic to use postgres db