fixed crash when setting limit on cache size