fixed removal of tmp file