fix crash on iOS 6