use checkbox to show button

I did that

$w.onReady(function () {
   $w("#checkbox2").onChange((event) => {console.log(isChecked2)
 let isChecked1 = $w('#checkbox1').checked;
 let isChecked2 = $w('#checkbox2').checked;
 if(isChecked1===true && isChecked2===true){
       $w("#button14").show()
       console.log("Checkbox is checked")
     }
 else{
       $w('#button14').hide()
       console.log("Checkbox is unchecked")
     }
   });
});

And more or less its working, but if I do the check box in this orther: Checkedbox 2 after checkedbox1 is not working. If I do in the normal way its working