Added calls to query stats