; or (B) there is a shortage of housing units available for sale that are affordable to individuals with an income that is at or below the area median income and median home prices have risen on average over the preceding 3 years substantially faster than the area median income. (4) Use of funds Grants received under this subsection shall be used to fund— (A) the construction of rental housing units or units for purchase that are affordable to residents making less than 120 percent of the area median income; and (B) measures to prevent tenant displacement and harassment, including the provision of legal advice and representation for tenants facing eviction, enforcement of anti-harassment laws, emergency rental assistance, and other measures as specified by the Secretary of Housing and Urban Development. (5) Labor laws (A) In general All laborers and mechanics employed by contractors or subcontractors in the performance of construction work financed in whole or in part with a grant received under this subsection shall be paid wages at rates not less than those prevailing on similar construction in the locality as determined by the Secretary of Labor in accordance with subchapter IV of chapter 31 of title 40, United States Code (commonly known as the Davis-Bacon Act ). (B) Exception Subparagraph (A) shall not apply with respect to— (i) the rehabilitation of residential property if the property contains less than 8 units