added tcp capture logic