fixed a bug originating in swapping of filtering order