fix sort of events