Added click listener and corresponding handler for checkbox.