fix tmp file deletion, exit after trap