bind click event to the relevant class