catch tcp errors