added emitting helper function