fix tmpdir issues