update DOM and events