make DistributedReference constructor public & fix bug = 0
add newId allocation for newRef