fixed annoying bug in cache