modify protocol to avoid arrayoutofbounds for substrings