updated button functionality