use `mktemp` to create tempfile.