Add clear dir logics.