Fixed the cwd changed problem.