fix states_count