$chan is the proper way to do it; avoid using it apart from in the top bar: on :TEXT:?math :#: {
^ That's fine; but dont use it in the rest of the script