fix torch + cleanup