Fix the broken check state logic
Merge pull request #13443 from makinacorpus/fixlogic

Fix the broken check state logic