Added generic filter function to set checked value