adding caching functionality