updated update button functionality