fixed deprecated api in iOS 7