changed the order of the events