added counts to the query