fix the auto merge bugs