Both buyer and seller have to mutually agree to instruct escrow to refund the earnest money deposit to the buyer.