fixed delete[] bug:write data to out of index