Fixed sub unsub in loop