I have a script that will unset a variable once I leave a channel. It should then echo that the variable was unset into my active window. The problem I'm having is that I can't get the echo to work. It keeps on trying to echo to the channel that I've left, and of course it can't find it. Please help.

Code:
on *:PART:#mychan:{ 
  if ($nick == $me) {
    unset %thisvar
    echo -a Variable unset.
  }
}