avoid crash unusual directories