fix error in iOS SDK 6+