return the tempfile correctly