replace condition in filter.toString