Fixed null pointer exception in cache manager