fix bugs and features

fix bugs and features