modify the construction of dirs