Fix the broken check state logic