correct _update_rule_for_state function