Fix states scripts issues