fix incorrect tempdir use