updated create tempfile to use newer tuque functions