added output dir option