Prior to the treaty ratification, Augustus still managed to defeat at Kalisz a combined Swedish and Warsaw Confederation force, which left most of the Commonwealth clear of the Swedish occupiers, until Charles entered through Silesia again. The Sandomierz Confederation held to their alliance with Peter I of Russia also during the Charles' Moscow offensive, when the Russian troops left Poland. Stanisław Leszczyński's forces, charged with protecting the rear end, were defeated by his and Charles' Polish adversaries at the Battle of Koniecpol. Stanisław and von Krassow (commander of the Swedish units left in Poland), thwarted by the Sandomierz confederates again, were unable to break through to join Charles who was stuck in Ukraine, where the Cossack hetman Ivan Mazepa largely failed to deliver on his promised support for the Swedes. The Swedish supply train approaching from Livonia was destroyed by the Russians, and thus the actions of the Sandomierz Confederation alliance significantly contributed to Charles' ultimate failure at the Battle of Poltava in 1709.