use mktemp instead of $TEMPDIR