Added indexOf support for IE8