updated for iOS 5.1 support