update button toggle state