fixed a bug where ie doesnt support indexOf