fix: loop from getminfilterindex(n) to get maxfilterindex(n) -1