fix calling order of onInit