added functionality to merge/finish button