to add the error handle on the server side close in tc.pl