chdir to tmpdir