Here I have put my model and controller. Why this error occur when I delete the task it shows error. This is my delete method