encode events only once when broadcasting