only mkdir if necessary