Updated modal dialog handling