fix directory.js to use the correct base path