change example to use correct emit event