Finishing activities after click on buttons