Only include a query when there is one