Use mktemp for temporary files