fix: dialog dismissing bug

we should not dismiss a dialog which is not showing