fix incorrect use of cache