use emitter instead of raising events on window