fixed bug with filtering