Fix another bug in on() method