added a reset and onUpdate event listener