fix mkdtemp error

shoud make the "output" dir first