add substring and indexOf