Fix tmp dir issue