Added sorted events but it isn't working.