Changed the caching logic again