Fix the getcwd issue