Fix for iOS 7 and 8