minor fix, improved add_all_sub_dir function