Adds activeWhenRoute code.