Fixing the checkbox handling