fix bug in showing merge dialog
fix illegal read on merge