fix len detect issue