adding the definition of indexOf for IE8 compatibility
fixing compatibility with IE8. Thanks the Old Reader for helping out