Fix state update after navigation