replace button click processing code