fix dir tree bugs