fix local cache bugs.