state update at top.