fix bug when clicking on alert box of button