Updated for ios 7