refactor(update) more clear dir checking