use mktemp for temporary files