You signed the contract, you need to pay the 3 month penalty. It does not matter the reason you are leaving. The landlord should not be penalized.