fix issues with output dir