ensure tmp file cleanup