Fixed state setting issue