add and remove observer in viewDidAppear/viewDidDisappear methods