fix few bugs on the filter