using db object instead dbQuery() function