diff --git a/NIDAQmxInterface.cpp b/NIDAQmxInterface.cpp
index a4dbbe1..09d0443 100644
--- a/NIDAQmxInterface.cpp
+++ b/NIDAQmxInterface.cpp
@@ -127,6 +127,7 @@ void NIDAQmxInterface::DAQmxDestroyInterface()
     DAQmxStopCustomTask(daq->di_port);
     DAQmxStopCustomTask(daq->do_port);
     DAQmxStopCustomTask(daq->do_clk);
+    DAQmxStopCustomTask(daq->di_error);
 
     /* clear tasks */
     DAQmxErrChk(DAQmxClearTask(daq->di_port));
@@ -135,6 +136,8 @@ void NIDAQmxInterface::DAQmxDestroyInterface()
     daq->do_port = 0;
     DAQmxErrChk(DAQmxClearTask(daq->do_clk));
     daq->do_clk = 0;
+    DAQmxErrChk(DAQmxClearTask(daq->di_error));
+    daq->di_error = 0;
 
     return;
 }