Corrects logic for state decision