fixed deprecated methods for iOS7