fixed broken temp file deletion