fix issue: crash when init cache
merge code