Only apply the filter when we're in the loop. Otherwise, it can get applied for things like HEAD