Code updated to adding rootViewcontroller to Window