Exhibit10.2

FOURTH AMENDMENT TOFIRST AMENDED AND RESTATEDWAREHOUSING CREDIT AND SECURITYAGREEMENT

FOURTH AMENDMENT TO FIRSTAMENDED AND RESTATED WAREHOUSING CREDIT AND SECURITY AGREEMENT (this"Amendment") dated as of August 9,2005, between MORTGAGEIT, INC., a New York corporation("Borrower") and RESIDENTIAL FUNDINGCORPORATION, a Delaware corporation("Lender").

|          |                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
|----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| A.  | Borrower and Lender have entered into arevolving mortgage warehousing facility with a present WarehousingCommitment Amount of $400,000,000, temporarily increased to$420,000,000, which is evidenced by a Promissory Note dated April 12,2005 (the "Note"), and by a FirstAmended and Restated Warehousing Credit and Security Agreement dated asof April  12, 2005 (as the same may have been and may be amendedor supplemented, the"Agreement"). |

|          |                                                                                                                                                                                                                                                                                                                    |
|----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| B.  | Borrower has requested that Lender furtherincrease and extend the temporary increase of the WarehousingCommitment Amount and amend certain other terms of the Agreement, andLender has agreed to such temporary increase and those certain otheramendments, subject to the terms and conditions of this Amendment. |

NOW, THEREFORE, the parties to this Amendment agree as follows:

|          |                                                                                                                                                      |
|----------|------------------------------------------------------------------------------------------------------------------------------------------------------|
| 1.  | Subject to Borrower's satisfaction ofthe conditions set forth in Section 12 the effective date of thisAmendment is August 9, 2005 ("EffectiveDate"). |

|          |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
|----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 2.  | Unlessotherwise defined in this Amendment, all capitalized terms have themeanings given to those terms in the Agreement. Defined terms may beused in the singular or the plural, as the context requires. The words"include,""includes" and"including" are deemed to be followed by thephrase "without limitation." Unless thecontext in which it is used otherwise clearly requires, the word"or" has the inclusive meaning represented bythe phrase "and/or." References to Sectionsand Exhibits are to Sections and Exhibits of this Amendment unlessotherwise expressly provided. |

|          |                                                                                                                                               |
|----------|-----------------------------------------------------------------------------------------------------------------------------------------------|
| 3.  | TheTable of Contents of the Agreement is amended and restated inits entirety as set forth in the Table of Contents attached tothis Amendment. |

|          |                                                                                                                                                                                                                                                                                      |
|----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 4.  | Article 7 of theAgreement is amended and restated in its entirety as set forth inArticle 7 attached to this Amendment. All references in theAgreement and other Loan Documents to Article 7 (includingeach and every Section in Article 7) are deemed to refer tothe new Article  7. |

|          |                                                                                                                                                                                                                                                                                      |
|----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 5.  | Article 8 of the Agreement isamended and restated in its entirety as set forth in Article 8attached to this Amendment. All references in the Agreement and otherLoan Documents to Article 8 (including each and every Sectionin Article 8) are deemed to refer to the newArticle  8. |

|          |                                                                                                                                                                                                                                                                                          |
|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 6.  | Article12 of the Agreement is amended and restated in its entirety as setforth in Article 12 attached to this Amendment. All referencesin the Agreement and other Loan Documents to Article 12(including each and every Section in Article 12) are deemed torefer to the new Article 12. |

1

----

|          |                                                                                                                                                                                                                                         |
|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 7.  | Exhibit E-1to the Agreement is amended and restated in its entirety as set forthin Exhibit E-1 to this Amendment. All references in theAgreement and the other Loan Documents to Exhibit E-1 aredeemed to refer to the new Exhibit E-1. |

|          |                                                                                                                                                                                                                                         |
|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 8.  | Exhibit E-2 to the Agreement isamended and restated in its entirety as set forth in ExhibitE-2 to this Amendment. All references in the Agreement and theother Loan Documents to Exhibit E-2 are deemed to refer to thenew Exhibit E-2. |

|          |                                                                                                                                                                                                                                 |
|----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 9.  | ExhibitH to the Agreement is amended and restated in its entirety as setforth in Exhibit H to this Amendment. All references in theAgreement and the other Loan Documents to Exhibit H are deemedto refer to the new Exhibit H. |

|           |                                                                                                                                                                                                                                 |
|-----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 10.  | Exhibit I to the Agreement isamended and restated in its entirety as set forth in Exhibit Ito this Amendment. All references in the Agreement and the other LoanDocuments to Exhibit I are deemed to refer to the newExhibit I. |

|           |                                                         |
|-----------|---------------------------------------------------------|
| 11.  | The following Eventsof Default exist under theAgreement |

|  |           |                                                                                                                                                             |
|--|-----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------|
|  | (a)  | Borrower failed tocomply with the Leverage Ratio for Guarantor covenant set forth inSection 8.11 of the Agreement for the fiscal month ended April 30,2005. |

|  |           |                                                                                                                                                                                   |
|--|-----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|  | (b)  | Borrower failed to complywith the Liquid Assets for Guarantor covenant set forth in Section 8.13of the Agreement for the fiscal months ended February 28, 2005 andMarch 31, 2005. |

Failure to comply with thesecovenants constitute Events of Default pursuant to Section 10.1(b) ofthe Agreement.

Borrower has requested thatLender waive its rights and remedies with respect to theabove-described Events of Default. Lender agrees to waive its rightsand remedies with respect to the above-described Events of Default;provided, however, that the waivers are limited tothe specific Events of Default described above and are not intended andwill not be construed to be a waiver of any future Default or Event ofDefault of Section 8.11 or Section 8.13 of the Agreement or anyexisting or future Default or Event of Default under any otherprovision of the Agreement.

**BORROWER ISNOTIFIED THROUGH THIS AMENDMENT THAT LENDER REQUIRES STRICT COMPLIANCEBY BORROWER OF ALL TERMS, CONDITIONS AND PROVISIONS OF THE AGREEMENTAND LOAN DOCUMENTS.**

The waivers ofLender under this Amendment may not be construed as establishing acourse of conduct on the part of Lender upon which Borrower may rely atany time in the future, and Borrower expressly waives any right toassert any claim to such effect at any time.

|           |                                                                                                                                                      |
|-----------|------------------------------------------------------------------------------------------------------------------------------------------------------|
| 12.  | Borrower must deliver to Lender (a) twoexecuted copies of this Amendment, (b) the Additional Commitment Fees,and (c) a $500 document production fee. |

|           |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
|-----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 13.  | Borrower represents, warrants and agreesthat (a) except as stated in paragraph 11 above, there exists noDefault or Event of Default under the Loan Documents, (b) the LoanDocuments continue to be the legal, valid and binding agreements andobligations of Borrower, enforceable in accordance with their terms, asmodified by this Amendment, (c) Lender is not in default under any ofthe Loan Documents and Borrower has no offset or defense to itsperformance or obligations under any of the Loan Documents, (d) exceptfor changes permitted by the terms of the Agreement, Borrower'srepresentations and |

2

----

|        |                                                                                                                                                                                                                                                           |
|--------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|   | warranties contained in the Loan Documents aretrue, accurate and complete in all respects as of the Effective Dateand (e) there has been no material adverse change in Borrower'sfinancial condition from the date of the Agreement to the EffectiveDate. |

|           |                                                                                                                                                                                                          |
|-----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 14.  | Except as expressly modified, theAgreement is unchanged and remains in full force and effect, andBorrower ratifies and reaffirms all of its obligations under theAgreement and the other Loan Documents. |

|           |                                                                                                                                                                                   |
|-----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 15.  | This Amendment may be executed in any numberof counterparts, each of which will be deemed an original, but all ofwhich shall together constitute but one and the same instrument. |

IN WITNESS WHEREOF, Borrower and Lender have caused this Amendmentto be duly executed on their behalf by their duly authorized officersas of the day and year above written.

|        |  |                                                        |  |        |  |  |  |  |  |  |
|--------|--|--------------------------------------------------------|--|--------|--|--|--|--|--|--|
|   |  | MORTGAGEIT,INC., a New York corporation                |  |   |
|   |  | By: JohnR. Cuti                                        |  |
|   |  | Its:General Counsel and Secretary                      |  |
|   |  | RESIDENTIAL FUNDINGCORPORATION, a Delaware corporation |  |
|   |  | By: JasonGaul                                          |  |
|   |  | Its:Director                                           |  |
|        |

3

----