fix some bugs caused compile error