support arbitrary working directory and run directory