Finally understood and fixed the TCP data coruption.