fix bug for tcp