fixed the test_dir chdir for file creation