adds button functionality