change the directory by chdir function