Zaid came to Amr advising him to invest a sum of money in the stock exchange, and told him: "Don't worry, I got this." Accordingly, Amr understood that the profit will be 50/50 and Zaid alone will be liable for the loss. Amr paid that sum as a mixture of investment and debt. The contract was concluded in Zaid`s name who paid (20000 JDS) by Amr. Within 45 days, they made a profit of about (6000 JDs) and this amount was divided equally between them. However, after a few days, the stock exchange collapsed and all the investors lost their money. Zaid filed a case against the stock exchange, but it was of no avail. Zaid committed to pay (17000 JDs) to Amr. I.e. the capital minus his portion of the profit (3000 JDs). What is the ruling of Sharia on this contract?