added extra support for ios 5