Added some filtering logic