fix circular references