ios flip crash fix