generate temp dir correctly.