call mkdir only once