Why aren't you defining filter as an option and then check the option instead this would seem to be a more straightforward and consistent approach.