Fixing indexOf for IE 7