Fix for iOS 5 crash