use tempname() instead of "/tmp"