You agent should be able to help you. You often can get out of the contract without losing the earnest money if you can't get a loan, not happy with the inspection, etc.