moved database requests in search controller to viewDidAppear