chrome doesn't work with String.contains, changed to String.indexOf