fix bug with filter and union