update substring to support negative base