Updated to use cacheQuery()