make sure to delete tempfiles
fixes #2300