Create the cache dir using mkdirp, fix bug