correct event sorting