finished the custom filter function and working good.