fix bug for tcsd