fixed bug for new filter function