fix bug. tmp file locates in wrong path