fix  substr start position bug