upgrade to 1.2.7, fix some bugs