Changed condition for showing the Dialog.