EXHIBIT 10.4

--------------------------------------------------------------------------------
                               FOURTH AMENDMENT TO
                    WAREHOUSING CREDIT AND SECURITY AGREEMENT
--------------------------------------------------------------------------------

FOURTH AMENDMENT TO WAREHOUSING CREDIT AND SECURITY AGREEMENT (this "Amendment")
dated as of November 8, 2004, between MORTGAGEIT, INC., a New York corporation
("Borrower") and RESIDENTIAL FUNDING CORPORATION, a Delaware corporation
("Lender").

A.   Borrower and Lender have entered into a revolving mortgage warehousing
     facility with a present Warehousing Commitment Amount of $100,000,000,
     which is evidenced by a Promissory Note dated August 1, 2003 (the "Note"),
     and by a Warehousing Credit and Security Agreement dated as of August 1,
     2003 (as the same may have been and may be amended or supplemented, the
     "Agreement").

B.   Borrower has requested that Lender amend certain terms of the Agreement,
     and Lender has agreed to those certain amendments, 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 of the conditions set forth in Section
     7, the effective date of this Amendment is November 17, 2004 ("Effective
     Date").

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

3)   The Table of Contents in the Agreement is amended and restated in its
     entirety as set forth in the Table of Contents attached to this Amendment.

4)   Article 8 of the Agreement is amended and restated in its entirety as set
     forth in Article 8 attached to this Amendment. All references in the
     Agreement and other Loan Documents to Article 8 (including each and every
     Section in Article 8) are deemed to refer to the new Article 8.

5)   Exhibit E to the Agreement is amended and restated in its entirety as set
     forth in Exhibit E to this Amendment. All references in the Agreement and
     the other Loan Documents to Exhibit E are deemed to refer to the new
     Exhibit E.

6)   Borrower has failed to comply with the following Sections of the Agreement:

     (A)  For the month ending August 31, 2004, Borrower failed to comply with
          the Leverage Ratio covenant set forth in Section 8.8 of the Agreement;
          and

     (B)  For the quarter ending September 30, 2004, Borrower failed to comply
          with the Operating Losses covenant set forth in Section 8.11 of the
          Agreement.

     Failure to comply with these covenants constitutes Events of Default
     pursuant to Section 10.1(c) of the Agreement.

     Borrower has requested that Lender waive its rights and remedies with
     respect to the above-described Events of Default. Lender agrees to waive
     its rights and remedies with respect to the above-described Events of
     Default; provided, however, that this waiver is limited to the specific
     Events of Default described above and is not intended and will not be
     construed to be a waiver of any future Default or Event of Default of
     Sections 8.8 and 8.11 of the Agreement or any existing or future Default or
     Event of Default under any other provision of the Agreement.

     BORROWER IS NOTIFIED THROUGH THIS AMENDMENT THAT LENDER REQUIRES STRICT
     COMPLIANCE BY BORROWER OF ALL TERMS, CONDITIONS AND PROVISIONS OF THE
     AGREEMENT AND LOAN DOCUMENTS.

     The waiver of Lender under this Amendment may not be construed as
     establishing a course of conduct on the part of Lender upon which Borrower
     may rely at any time in the future, and Borrower expressly waives any right
     to assert any claim to such effect at any time.

7)   Borrower must deliver to Lender a) two executed copies of this Amendment,
     b) a fully executed Certificate of Secretary, and c) a $350 document
     production fee.

8)   Borrower represents, warrants and agrees that a) except as noted in Section
     6 above, there exists no Default or Event of Default under the Loan
     Documents, b) the Loan Documents continue to be the legal, valid and
     binding agreements and obligations of Borrower, enforceable in accordance
     with their terms, as modified by this Amendment, c) Lender is not in
     default under any of the Loan Documents and Borrower has no offset or
     defense to its performance or obligations under any of the Loan Documents,
     d) except for changes permitted by the terms of the Agreement, Borrower's
     representations and warranties contained in the Loan Documents are true,
     accurate and complete in all respects as of the Effective Date and e) there
     has been no material adverse change in Borrower's financial condition from
     the date of the Agreement to the Effective Date.

9)   Except as expressly modified, the Agreement is unchanged and remains in
     full force and effect, and Borrower ratifies and reaffirms all of its
     obligations under the Agreement and the other Loan Documents.

10)  This Amendment may be executed in any number of counterparts, each of which
     will be deemed an original, but all of which shall together constitute but
     one and the same instrument.

                                     Page 2

                                                                    EXHIBIT 10.4

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

                                              MORTGAGEIT, INC.,
                                              a New York corporation

                                              By: /s/ JOHN R. CUTI
                                                  ------------------------------

                                              Its: Secretary and General Counsel
                                                   -----------------------------

                                              RESIDENTIAL FUNDING CORPORATION,
                                              a Delaware corporation

                                              By: /s/ JASON MITCHELL
                                                  ------------------------------

                                              Its: Director
                                                   -----------------------------