fixed a bug in the rest filter