fix some bugs: