implement alert and confirm popup