fix checkstate