modify stop_button_clicked function