Switching .indexOf for IE8 support