fix some bugs after table changed