Modify the code for working buttons.