fix order + added sortByOrder function call + eventOrderMap logic