Fixing broken database caching engine