fixed states bug