Only fetch if there is a query