Used indexOf instead of isSubstring