automatically build sub directories