Modified the initialization method for alertDialog