Work on the ui events