changed to ViewWillAppear to stop flicker