finish substring problem.