Updated filter logic.