                 }
             }
         }
-        if let score = object {
-            chatCell.label.text = score["message"] as? String
-        }
+        chatCell.label.text = post.message
         return chatCell
     }
 
 }
+
+class Post : PFObject {
+    var likes: Set<String>? {
+        guard let likesObj = self["likes"],
+            let likesString = likesObj as? [String] else {
+                return nil
+        }
+        return Set<String>(likesString)
+    }
+    var message: String? {
+        return self["message"] as? String
+    }
+}


        let chatCell = tableView.dequeueReusableCell(withIdentifier: "ChatCell", for: indexPath) as! ChatCell

        if let likesArr = object?["likes"] {
            let likes = Set<String>( likesArr as! [String])
            if likes.contains(PFUser.current()!.objectId!) {
                chatCell.likeButton.isEnabled = false
            } else {


        chatCell.liked = {

            if var likes = post.likes {
                
                likes.insert(PFUser.current()!.objectId!)
                post["likes"] = Array(likes)
                post.saveInBackground { (success, error) in
                    if (success) {
                        print("like succeed")
                    } else {
