fix some bugs, add features