added UI event handler function