fix output directory creation