Fix the broken check state logic

(CherryPick Edit)
cc @basepi