Slight change to logic check for indexOf