fix reallocation memory in appendStringBuffer