keep a reference for Tempfile to avoid being GC'd