fix invalidate_cache method