Use the correct variable when filtering