fixed bug with crash on ios 5