Added parameter to isDialogOpen