fix a bug on .emit()