modify logic for pre_button