added boolean choice to setFilter function