added viewWillAppear method