use tmpdir var instead of hardcoded /tmp