Updated for ios8