Add filter logic