fixed crash on iOS