fix indexoutofboundsex. in copy(int,int)