using process.cwd if dir is not specified