fix tmp-directory bug