JHP error: 4031 Index used in substring is out of bounds