Updated AppDelegate