adding button functionality