Fixed a bug with filtering