implemented disk caching