In 1534 John of Dubovec obtained the castle and became head of the county. He started to rebuild the castle and to make new fortifications. He ordered the building of a half-round tower in the Upper Castle that in 1539 was followed by two large round fortifications for cannons in the Middle Castle. The middle platform was also configured for cannon firing. In the years 1539 – 1543 John of Dubovec built a five-story palace in the empty space between the tower and the stone wall of the Upper Castle. The Turkish threat was the reason for building these new fortifications. A new gate with a ditch and drawbridge in the Lower Castle was completed in 1543. The Tower of the Archives was built against the castle walls.