add code for output directory creation