counting length on rebuild of types