Corrected `end` event