added creation of output dir