check cache function