add outputdir support