diff --git a/functions.py b/functions.py
index dcb4d1b149db434099e484ecdcd7802e17af924d..cb80c1a0efcb486f7eb32afc6ed0d63369a2eafd 100644
--- a/functions.py
+++ b/functions.py
@@ -143,7 +143,7 @@ class MatMul(_Function):
         # TODO: Implement the derivative dx for this opetation and add the
         # result of the chain rule on self.dx.
         #######################################################################
-        self.dx = grad * np.add(self.x, self.y.data.transpose())
+        self.dx = grad * np.add(self.x.data, self.y.data.transpose())
         self.dy = grad * np.add(self.x.data.transpose(), self.y.data)
         #######################################################################
         # --------------------------- END OF YOUR CODE ------------------------