     
     func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
         selectedMovie = self.filteredMovies[indexPath.row]
+        // set background for navbar
+        let imgUrl = posterBaseUrl + (selectedMovie["poster_path"] as? String)!
+        Alamofire.request(imgUrl, method: .get).responseImage { response in
+            guard let image = response.result.value else {
+                // Handle error
+                return
+            }
+            self.navigationController?.navigationBar.setBackgroundImage(image, for: UIBarMetrics.default)
+        }
+        
         performSegue(withIdentifier: "showDetail", sender: self)
     }
     

    
    func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
        selectedMovie = self.filteredMovies[indexPath.row]
        performSegue(withIdentifier: "showDetail", sender: self)
    }
    

        viewTypeChanged(self)
        
        self.loadJsonData()
        
        self.navigationController?.navigationBar.barTintColor = UIColor.blue
    }
    
    override func didReceiveMemoryWarning() {
