fix(dialog): correctly handle stacked dialogs