1 Exhibit 10.5.2 MAHASKA INVESTMENT COMPANY THIRD AMENDMENT TO CREDIT AGREEMENT Harris Trust and Savings Bank Chicago, Illinois Ladies and Gentlemen: Reference is hereby made to that certain Credit Agreement dated as of January 31, 1996, as amended (the "Credit Agreement"), between the undersigned, Mahaska Investment Company, an Iowa corporation (the "Borrower"), and you (the "Bank"). All capitalized terms used herein without definition shall have the same meanings herein as such terms have in the Credit Agreement. The Borrower and the Bank have agreed to amend the Credit Agreement under the terms and conditions set forth in this agreement (herein, the "Amendment"). 1. AMENDMENTS. Upon your acceptance hereof in the space provided for that purpose below, the Credit Agreement shall be and hereby is amended as follows: (a) The first sentence of Section 3 of the Credit Agreement shall be amended and restated in its entirety to read as follows: "The payment and performance of the Obligations shall at all times be secured by all of the issued and outstanding capital stock (except for directors' qualifying shares as required by law) of each Subsidiary of the Borrower, whether now owned or hereafter formed or acquired, pursuant to a Pledge and Security Agreement dates as of October 17, 1997, as amended, between the Borrower and the Bank (the Pledge and Security Agreement, and all other instruments and documents as shall from time to time secure the Obligations or any part thereof, being hereinafter referred to as the "Collateral Documents")." page 1 2 (b) Schedule 5.2 to the Credit Agreement shall be amended in its entirety, and as amended it shall be restated to read as set forth on Schedule 5.2 attached hereto and made a part hereof. 2. CONDITIONS PRECEDENT. The effectiveness of this Amendment is subject to the satisfaction of all of the following conditions precedent: (a) The Borrower and the Bank shall have executed and delivered this Amendment. (b) The Borrower and the Bank shall have executed and delivered an amendment to the Collateral Documents in form and substance satisfactory to the Bank, the Borrower shall have executed and delivered to the Bank such UCC financing statements covering the Collateral as the Bank may request, and the Borrower shall have delivered to the Bank certificates for 100% of the capital stock of Pella State Bank together with executed stock powers therefor. (c) Legal matters incident to the execution and delivery of this Amendment shall be satisfactory to the Bank and its counsel. 3. REPRESENTATIONS. In order to induce the Bank to execute and deliver this Amendment, the Borrower hereby represents to the Bank that as of the date hereof, the representations and warranties set forth in Section 5 of the Credit Agreement are and shall be and remain true and correct (except that the representations contained in Section 5.5 shall be deemed to refer to the most recent financial statements of the Borrower delivered to the Bank) and the Borrower is in full compliance with all of the terms and conditions of the Credit Agreement and no Default or Event of Default has occurred and is continuing under the Credit Agreement or shall result after giving effect to this Amendment. 4. MISCELLANEOUS. page 2 3 (a) Except as specifically amended herein, the Credit Agreement shall continue in full force and effect in accordance with its original terms. Reference to this specific Amendment need not be made in the Credit Agreement, the Note, or any other instrument or document executed in connection therewith, or in any certificate, letter or communication issued or made pursuant to or with respect to the Credit Agreement, any reference in any of such items to the Credit Agreement being sufficient to refer to the Credit Agreement as amended hereby. (b) The Borrower agrees to pay on demand all costs and expenses of or incurred by the Bank in connection with the negotiation, preparation, execution and delivery of this Amendment, including the fees and expenses of counsel for the Bank. (c) This Amendment may be executed in any number of counterparts, and by the different parties on different counterpart signature pages, all of which taken together shall constitute one and the same agreement. Any of the parties hereto may execute this Amendment by signing any such counterpart and each of such counterparts shall for all purposes be deemed to be an original. This Amendment shall be governed by the internal laws of the State of Illinois. Dated as of November 20, 1997. MAHASKA INVESTMENT COMPANY By /s/ Charles S. Howard Its President Accepted and agreed to in Chicago, Illinois as of the date and year last above written. HARRIS TRUST AND SAVINGS BANK By /s/ Michael S. Cameli Its Vice President page 3 4 MAHASKA INVESTMENT COMPANY THIRD AMENDMENT TO PLEDGE AND SECURITY AGREEMENT Harris Trust and Savings Bank Chicago, Illinois Ladies and Gentlemen: Reference is hereby made to that certain Pledge and Security Agreement dated as of October 17, 1994, as amended (the Pledge and Security Agreement, as the same has been amended prior to the date hereof, being referred to herein as the "Pledge Agreement"), between the undersigned, Mahaska Investment Company, an Iowa corporation (the "Pledgor") and you (the "Bank"). All capitalized terms used herein without definition shall have the same meanings herein as such terms have in the Pledge Agreement. The Pledgor and the Bank have agreed to amend the Pledge Agreement under the terms and conditions set forth in this agreement (herein, the "Amendment"). 1. AMENDMENTS. Upon your acceptance hereof in the space provided for that purpose below, the Pledge Agreement shall be and hereby is amended as follows: (a) Pledgor is hereby granting the Bank a security interest in all shares of the capital stock of each subsidiary of the Pledgor, whether now owned or hereafter formed or acquired. Accordingly, the first paragraph of the Pledge Agreement is hereby amended and restated to read as follows: "FOR VALUE RECEIVED, the undersigned, Mahaska Investment Company, an Iowa corporation (the "Pledgor", hereby pledges and deposits with, and reaffirms its pledge and deposit with, Harris Trust and Savings Bank, Chicago, Illinois (the "Bank"), and hereby grants to, and reaffirms its grant to, the Bank a continuing security interest in and to (i) all shares of the capital stock of each subsidiary of the Pledgor, whether now or existing or hereafter formed or acquired (those shares page 4 5 delivered to and deposited with the Bank on or prior to the date hereof being listed and described on Schedule A attached hereto), (ii) all substitutions and additions to such shares, (iii) all dividends, distributions, and other sums distributable or payable from, upon, or in respect of, such shares, (iv) all other rights and privileges incident to such shares, and (v) all proceeds and products of the foregoing (all of the foregoing being hereinafter referred to collectively as the "Collateral")." (b) Schedule A to the Pledge Agreement is hereby replaced by Schedule A attached hereto. 2. MISCELLANEOUS. (a) Except as specifically amended herein, the Pledge Agreement shall continue in full force and effect in accordance with its original terms. Nothing herein contained shall in any manner affect or impair the priority of the liens and security interests created and provided for by the Pledge Agreement or any other instrument or document executed in connection therewith, or in any certificate, letter or communication issued or made pursuant to or with respect to the Pledge Agreement, any reference in any of such items to the Pledge Agreement being sufficient to refer to the Pledge Agreement as amended hereby. (b) This Amendment may be executed in any number of counterparts, and by the different parties on different counterpart signature pages, all of which taken together shall constitute one and the same agreement. Any of the parties hereto may execute this Amendment by signing any such counterpart and each of such counterparts shall for all purposes be deemed to be an original. This Amendment shall be governed by the internal laws of the State of Illinois. Dated as of November 20, 1997. MAHASKA INVESTMENT COMPANY By Its page 5 6 Accepted and agreed to in Chicago, Illinois as of the date and year last above written. HARRIS TRUST AND SAVINGS BANK By /s/ Michael Cameli Its Vice President SCHEDULE A THE COLLATERAL NAME OF ISSUER NUMBER OF SHARES CERTIFICATE NO(S). MAHASKA STATE BANK 20,000 1545 2,400 1546 CENTRAL VALLEY BANK 10,000 2 10,000 3 ON-SITE CREDIT SERVICES 40,000 1 PELLA STATE BANK 10,000 1 page 6 7 SCHEDULE 5.2 SUBSIDIARIES JURISDICTION OF NAME INCORPORATION PERCENTAGE OF OWNERSHIP Mahaska State Bank Iowa 100% Central Valley Bank United States of America 100% On-Site Credit Services Iowa 100% Pella State Bank Iowa 100% page 7