fix bugs, merge with master