fixed some bugs in v2.1