fix some bugs and update the doc