Changed the place of the call to viewWillAppear