fix subscripting issue for ios5