update UI and event handling