array copy bug fixed