filter: fix bug when given incorrect filter