Adjusted order of event triggering so that sort event is not triggered on failure