code for view filter plugin