added sorting on events