Hi @AjayaGummadi,
Please check out this post and pay attention to not mixing the regularization term into the error term. Note the two brackets in the formula. We finish computing the first bracket, and then we compute the second, and finally add both together.
Raymond