use find instead of index for substring search