Properly remove modal dialog