add working-directory option
fix bugs