added option to change output dir