Pass ctx to onInitialized