fixes IE7 incompatibility with string [] operator

replaced expr[index] with expr.charAt(index)