Bug fix: Checking correct variable for isFiltering