fork of core.memoize to fix the strange core.cache error