fix state confusion