Use reference instead of pointer when emitting events