Change contains to indexOf for cross-browser support