added the button functionality