Fix #1411 Cannot cloe alert

- FIx #1411