fix bugs in createCache