corrected bug with cache