fixed critical error in caching