fix potential bug about sending packet buffer