     }
     
     func getDataFromServer() {
-        db.child("posts").queryOrdered(byChild: "timestamp").observe(.childAdded, with: { (snapshot) in
+        self.db = Database.database().reference()
+        self.db.child("posts").queryOrdered(byChild: "timestamp").observe(.childAdded, with: { (snapshot) in
             let posts = snapshot.value! as! NSDictionary
             
             let postIds = posts.allKeys

    var postSubtitleArray = [String]()
    var postAuthorArray = [String]()
    var postImageURLArray = [String]()
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        db = Database.database().reference()
        
        let imageView = UIImageView(frame: CGRect(x: 0, y: 0, width: 38, height: 38))
        imageView.contentMode = .scaleAspectFit

                self.postAuthorArray.append(singlePost["createdBy"] as! String)
                self.postSubtitleArray.append(singlePost["subtitle"] as! String)
                self.postImageURLArray.append(singlePost["image"] as! String)
                self.postUIDArray.append(id as! String)
                
                self.feedTableView.reloadData()
            }
