Updated button functionality