Changing the working of the checkbox