fix some bugs and change some features