fix dir caching bug