move output from viewDidLoad to viewWillAppear