Update the code to work with iOS 8 and iPhone 6