Added support for ios 6