Fix: add checks to alert dialog