fix crash on iOS