added indexOf
returning string index and destroying stream when found