fix code for ios8