supporting cwd and root