"add sort function for eventqueue"