fixed local state updateer