modify copy function
fix some bug