seperate the check box on click event function from the template