added merge/finsih button functionality