handle cwd correctly