update button with condition logic