moved alert into viewDidAppear