add merge reply function and made some adjustments