bugfix tmp file removal