Remove this line, use a + 1 in the second argument of substr.