updated for iOS7 compatibility

the old method is deprecated in iOS7 - updated with new method.