fix bug in advanced filtering