switches order of event registration