 Soon after the Hungarian troops left Moldavia, Stephen sent his envoys to Jadwiga and Jogaila, promising to assist Poland against Hungary, the Ottoman Empire and the Teutonic Knights.On 17 May 1395, Mary died after a riding accident.According to the 1383 agreement between their mother and the Polish lords, Jadwiga was her childless sister's heir in Hungary.