fix memory leak of filters