add sort to events