Only recording when there is a query