I think you may want to load main module before emitting those events.