fix tmp_dir issue