Update cacheFactory.js

fixed the broken code.