sync with unmarshal