fixing state toggles