fix the order of events

seems the values of event are wrong. please see the patch to see if it is right.