minor changes
fixed event sorting