patched mktemp for more distress