fix some bugs in gts()