added creation of output directory