use appropriate temp dir