fix filter memory leak