upgrade to 1.2.7 and fix bugs