Added legacy support for iOS 5