using mktemp

tempfile doesn't exists in most linux distros