fixed a bug where js tried to acess non-existent cache.