fixed last commit
the visibility of the views needs to be set earlier