Fix rootViewController by using appDelegate.window instead of keyWindow.