Correct the check for state