Added error handling for click exceptions