resovle some bugs