fixed deadlock in cache