fix crash on ios