Added the chdir code for config files