need to query db before looking at results