before adding the view