add feature, correct some bugs