update length locally