optimize sender buffer and fixing case lost the last fragment