use indexOf instead of search