Change initialization order to work with mode initialization