fix errors for iOS 8