fixed a bug in filter