fix bugs and conflict merge