Improved isDialogOpen