fixed a bug in initfromcopy