fix variable hiding when finding filter to replace

Fix variable name so that variable in each doesn't hide parameter.  Before this change, calling replaceFilter replaces the wrong filter if there's more than one.