Fix bug in MessageDialog