fix a race on data fields and heap