fix bug for double triggering event of okbtn & cancelbtn