Fix order of onRoute event