Improve error handling of user click events.