fix bug for cache