add -w option to specify working dir