trying to get a db query to work