change order of events to more logical