fixes onInitialized event timing