iOS: fix crash on iOS 5.0 devices