fixed the totalsize is not long enough bug