Before doing the visual tree works