Fixed issue where dialogs would reappear after rotating screen.