add directories and clean up