fixed bug when upgrading chache db