adding multithreaded caching