add error counter
replace UDP by TCP