use `mktemp` to create temporary file