bug fix in copyNode and moveNode functions