added isCached() function