add support of customized output directory