emit the correct events