change all of the #'s to $active because in a dialog theres no such thing as $chan