Fix modal dialog problem