My concern is that this can be called asynchronously, correct? So, at least in theory, there's a chance that the state_listener will get invoked in the wrong order. Probably unlikely, unless there's a rapid fire number of events.    Thanks for the catch about not actually saving the result of the sort. 