sort events by a counter before firing them. adresses issue #94