Fix creating many hidden dialogs