change viewDidAppear to viewWillAppear

to avoid showing the previous data.