changed push notifications check from viewDidLoad to viewDidAppear