fix bug in :on-<event> macro code