fix some bugs for version 2.0