fix bug and clear code in cache.js