Since the castle gradually fell into disarray, in 1448 King Casimir IV of Poland gave the castle on the hill above the town to Maria, widow of Eliah, voivode of Moldavia as a dowry. In exchange, she refurbished the castle and reinforced it. In 1456 the town was granted yet another privilege. This time the king allowed the town authorities to stop all merchants passing by the town, and force them to sell their goods at the local market. This gave the town an additional boost, especially as the region was one of three salt-producing areas in Poland (the other two being Wieliczka and Bochnia), both not far from Kraków.