indexOf polyfill to prevent IE errors