use var instead of tempfile