Modify code for iOS 7.0 and 7.1

Apple sucks:(