fix states bug