Getting earnest money deposit back; cancelled contract
So I cancelled an assignment contract with a wholesaler. Closing date with Sept 10, but the title company wasn't able to close on time. They needed a blue dye test, but didn't keep me updated, until I finally asked and they said they had filed it with the wrong department or town. In the interim, I had reflected on potentially shady pattern in my interactions/encounters, I decided to cancel the deal per the contract as the title was not deliverable by the closing date, confirmed by the title company.
How do I get my earnest money deposit back, and when does the title company give it back?