<PAGE>

                                                                   EXHIBIT 10.40

                       SIXTH AMENDMENT TO CREDIT AGREEMENT

         THIS SIXTH AMENDMENT TO CREDIT AGREEMENT (the "Amendment"), dated as of
October 18, 2002, is by and among CH MORTGAGE COMPANY I, LTD., a Texas limited
partnership (the "Company"), the lenders (the "Lenders") party to the Credit
Agreement (defined below) and U.S. BANK NATIONAL ASSOCIATION, a national banking
association ("U.S. Bank"), as agent (in such capacity, the "Agent") for the
Lenders.

                                    Recitals

         A. The Company, the Agent and the Lenders are parties to a Credit
Agreement dated as of August 13, 1999, as amended by a First Amendment to Credit
Agreement dated as of August 14, 2000, by a Second Amendment to Credit Agreement
and Second Amendment to Pledge Agreement dated as of August 10, 2001, by a Third
Amendment to Credit Agreement dated as of February 22, 2002, by a Fourth
Amendment to Credit Agreement dated as of August 12, 2002, by a Fifth Amendment
to Credit Agreement dated as of September 25, 2002 and by an Agreement to
Increase Commitment Amounts (the "Increase Agreement") dated as of September 20,
2002 (as so amended, the "Credit Agreement"), pursuant to which the Lenders
provide the Company and certain Co-Borrowers with a revolving mortgage
warehousing credit facility.

         B. The Company, U.S. Bank National Association ("U.S. Bank") and
JPMorgan Chase Bank ("Chase") desire to extend the first period during which the
respective Commitment Amounts of U.S. Bank and Chase are temporarily increased.

         NOW, THEREFORE, in consideration of the premises herein contained and
other good and valuable consideration, the receipt and sufficiency of which are
hereby acknowledged, the parties hereto agree as follows:

                                    Article I

                                   Definitions

         Section 1.1 Incorporated Definitions. Capitalized terms used in this
Amendment, to the extent not otherwise defined herein, shall have the same
meanings as in the Credit Agreement.

                                   Article II

                   Concerning the Increased Commitment Amounts

         Section 2.1 Change to First Reduction Date for the Commitment Amount of
Chase. Effective as of November 25, 2002 (the "First Reduction Date"), the
Commitment Amount of Chase is hereby reduced from $110,000,000 to $65,000,000.
This Section 2.1 amends Section 2.1 of the Fifth Amendment.

<PAGE>

         Section 2.2 Change to First Reduction Date for the Commitment Amount of
U.S. Bank. Effective as of the First Reduction Date, the Commitment Amount of
U.S. Bank is hereby reduced from $135,000,000 to $80,000,000. This Section 2.2
amends Section 2.2 of the Fifth Amendment.

                                  Article III

                          Amendment to Credit Agreement

         Section 3.1 Schedule 5. Schedule 5 of the Credit Agreement is hereby
amended and restated in its entirety to read as set forth in Exhibit A hereto.

                                   Article IV

                              Conditions Precedent

         Section 4.1 Delivery of Documents. This Amendment shall be effective as
of the date hereof upon the delivery to the Agent by the Company of the
following documents and the satisfaction of the following conditions:

                  (a) a certificate of the Secretary or Assistant Secretary of
         the Company certifying the resolutions of its Board of Directors
         authorizing the execution, delivery and performance of this Amendment,
         and identifying the officers of the Company authorized to sign such
         instruments;

                  (b) payment of the fees and expenses specified in Section 5.05
         of the Credit Agreement to the parties entitled thereto.

                  (c) such other documents as the Agent may reasonably request.

                                   Article V

                                  Miscellaneous

         Section 5.1 The Company, the Agent, and each Lender party hereto
acknowledge that, as amended hereby, the Credit Agreement and the other Loan
Documents remain in full force and effect with respect to the Company and the
Lenders, and that each reference to the Credit Agreement or the Loan Documents
shall refer to the Credit Agreement, amended hereby. The Company confirms and
acknowledges that it will continue to comply with the covenants set out in the
Credit Agreement and the other Loan Documents, as amended hereby, and that its
representations and warranties set out in the Credit Agreement and the other
Loan Documents, as amended hereby, are true and correct as of the date of this
Amendment. The Company represents and warrants that (i) the execution, delivery
and performance of this Amendment (the "Amendment Documents") is within its
organizational powers and has been duly authorized by all necessary
organizational action; (ii) the Amendment Documents have been duly executed and
delivered by the Company and constitute the legal, valid and binding obligation
of the Company, enforceable against the Company in accordance with their terms
(subject to limitations as to enforceability which might result from bankruptcy,
insolvency, or other similar laws affecting

                                        2

<PAGE>

creditors' rights generally and general principles of equity) and (iii) no
Events of Default or Defaults exist.

         Section 5.2 The Company agrees to reimburse the Agent upon demand for
all reasonable expenses (including reasonable attorneys fees and legal expenses)
incurred by the Agent in the preparation, negotiation and execution of the
Amendment Documents and any other document required to be furnished herewith,
and to pay and save the Lenders harmless from all liability for any stamp or
other taxes which may be payable with respect to the execution or delivery of
the Amendment Documents, which obligations of the Company shall survive any
termination of the Credit Agreement.

         Section 5.3 This Amendment may be executed in as many counterparts as
may be deemed necessary or convenient, and by the different parties hereto on
separate counterparts, each of which, when so executed, shall be deemed an
original but all such counterparts shall constitute but one and the same
instrument.

         Section 5.4 Any provision of this Amendment which is prohibited or
unenforceable in any jurisdiction shall, as to such jurisdiction, be ineffective
to the extent of such prohibition or unenforceability without invalidating the
remaining portions hereof or affecting the validity or enforceability of such
provisions in any other jurisdiction.

         Section 5.5 This Amendment shall be governed by, and construed in
accordance with, the internal law, and not the law of conflicts, of the State of
Minnesota, but giving effect to federal laws applicable to national banks.

         Section 5.6 This Amendment shall be binding upon the Company, the
Lenders, the Agent and their respective successors and assigns, and shall inure
to the benefit of the Company, the Lenders, the Agent and the successors and
assigns of the Lenders and the Agent.

               [Remainder of this page intentionally left blank.]

                                        3

<PAGE>

         IN WITNESS WHEREOF, the undersigned have caused this instrument to be
executed as of the date first above written.

                         CH MORTGAGE COMPANY I, LTD.

                         By: CH Mortgage Company GP, Inc.,
                             its General Partner


                         By: /s/ Randall C. Present
                             --------------------------------
                             Randall C. Present
                             President

                         U.S. BANK NATIONAL ASSOCIATION,
                         as Agent and Lender


                         By: /s/ Kathleen M. Connor
                             --------------------------------
                             Kathleen M. Connor
                             Vice President


             [Signature Page to Fifth Amendment to Credit Agreement]

                                       S-1

<PAGE>

                         NATIONAL CITY BANK OF KENTUCKY

                         By: /s/ Michael A. Johnson
                             ----------------------------------
                         Name:
                               --------------------------------
                         Title:
                                -------------------------------


             [Signature Page to Fifth Amendment to Credit Agreement]

                                        2

<PAGE>

                                         JPMORGAN CHASE BANK


                                         By: /s/ Cynthia E. Crites
                                             -----------------------------------
                                         Name:
                                               ---------------------------------
                                         Title:
                                                --------------------------------


             [Signature Page to Fifth Amendment to Credit Agreement]

                                        3

<PAGE>

                                         COMERICA BANK


                                         By: /s/ Robert W. Marr
                                             -----------------------------------
                                         Name:
                                               ---------------------------------
                                         Title:
                                                --------------------------------


             [Signature Page to Fifth Amendment to Credit Agreement]

                                        4

<PAGE>

                                                    EXHIBIT A TO SIXTH AMENDMENT
                                                             TO CREDIT AGREEMENT

                                                                   Schedule 5 to
                                                                Credit Agreement

                    COMMITMENT AMOUNTS AND PERCENTAGE SHARES

Before the reduction of U.S. Bank National Association's and JPMorgan Chase
Bank's Commitment Amounts to $80,000,000 and $65,000,000, respectively, on
November 25, 2002:

                                                Commitment        Percentage
                                                  Amount            Share
                                                  ------            -----
         U.S. Bank National Association        $135,000,000         45.00%
         National City Bank of Kentucky        $ 25,000,000          8.33%
         Comerica Bank                         $ 30,000,000         10.00%
         JPMorgan Chase Bank                   $110,000,000         36.67%
                                               ------------       --------

                           Total               $300,000,000        100.00%

On and after the reduction of U.S. Bank National Association's and JPMorgan
Chase Bank's Commitment Amounts to $80,000,000 and $65,000,000, respectively, on
November 25, 2002, but prior to the reduction of JP Morgan Chase Bank's
Commitment Amount to $55,000,000 on December 20, 2002:

                                                Commitment        Percentage
                                                  Amount            Share
                                                  ------            -----
         U.S. Bank National Association        $ 80,000,000         40.00%
         National City Bank of Kentucky        $ 25,000,000         12.50%
         Comerica Bank                         $ 30,000,000         15.00%
         JPMorgan Chase Bank                   $ 65,000,000         32.50%
                                               ------------         ------

         Total                                 $200,000,000        100.00%

On and after the reduction of JPMorgan Chase Bank's Commitment Amount to
$55,000,000 on December 20, 2002:

                                                Commitment        Percentage
                                                  Amount            Share
                                                  ------            -----
         U.S. Bank National Association        $ 80,000,000         42.10%
         National City Bank of Kentucky        $ 25,000,000         13.16%
         Comerica Bank                         $ 30,000,000         15.79%
         JPMorgan Chase Bank                   $ 55,000,000         28.95%
                                               ------------         ------

         Total                                 $190,000,000        100.00%