Added checks for iOS 6 and 7