Fixed a problem with asynchronous sorting of event listeners