fixed cache check bug