Added compatibility for iOS 5.1