fixed the broken chdir