added check for cached books