after loop, reset cwd.