Added 'end' event to scanner