fix some bugs, such as the mismatching of table id