Fix compatibility issue for iOS 5.