Updated case query for query on live data.