fix tmp directory bug