fix adding directories to the cache