workaround for #826

The bad news is, this leaks temp files.