Format name dir if needed