fix the way click event handlers work