Upgrade iOS code for iOS 8 bug fix