Move emit of invalid protocol to nextTick because the handlers are not initialized yet there