fixing state references