correct some bugs and add test