emits "end"