update middleware event handling
update package.json