diff --git a/src/cdf_filter.c b/src/cdf_filter.c
index 615208ca3c0e2bce59972f73e112abb3b27a3978..4c4cea08015f52b7aae8668546e3399cf6e9215a 100644
--- a/src/cdf_filter.c
+++ b/src/cdf_filter.c
@@ -94,8 +94,9 @@ cdf_def_var_filter(int ncid, int ncvarID, const char *filterSpec)
           for (size_t i = 0; i < nfilters; i++)
             {
               unsigned int filterid = filters[i]->filterid;
-              // printf("filter %zu id:%d nparams:%zu param1 %d %d\n", i + 1, filterid, filters[i]->nparams, filters[i]->params[0],
-              // filters[i]->params[1]);
+              // printf("filter %zu id:%d nparams:%zu param1 %d\n", i + 1, filterid, filters[i]->nparams, filters[i]->params[0]);
+              status = nc_inq_filter_avail(ncid, filterid);
+              if (status != NC_NOERR) Error("%s", nc_strerror(status));
               status = nc_def_var_filter(ncid, ncvarID, filterid, filters[i]->nparams, filters[i]->params);
               if (status != NC_NOERR)
                 {